PDA

View Full Version : Making Text Invisible


getwired
06-09-2005, 08:18 AM
Yet another question... :-) I am having a problem making text invisible. I am currently making my entire view turn to opacity of 0, and all goes away but the text it contains. I've tried satting visibility of the text to false, but again no luck. Anyone else encounter this problem?

In the case below... When I set wizTxt to opacity of 0 and also set it to invisible, all of the text contained within the testTxt text element, as well as the text contained in the button and next to the checkbox, remain visible...

<view name="wizTxt" width="${parent.width}" height="${parent.height}" visible="true">
<text name="testTxt" x="10" y="10" width="${parent.width - 20}" height="${parent.height - 20}" multiline="true">
<font face="serifont" size="16">
<p>Some text.</p>

<p>Some more text.</p>
</font>
</text>

<view x="${parent.width - 230}" y="${parent.height - 40}">
<checkbox x="12" id="dontShow" text="skip this next time" value="false"/>
<button height="20" text="continue" onclick="wizImg.bending_move.doStart()" />
<simplelayout axis="x" spacing="12"/>
</view>

</view>
</view>

<view x="${parent.width - 230}" y="${parent.height - 40}">
<checkbox x="12" id="dontShow" text="skip this next time" value="false"/>
<button height="20" text="continue" onclick="wizImg.bending_move.doStart()" />
<simplelayout axis="x" spacing="12"/>
</view>

</view>

getwired
06-09-2005, 09:15 AM
Ok, narrowed it down a bit... It seems that the problem is that I am trying to make text invisible within another view which already has animation started. Is this ia Laszlo limitation?

dzafer
06-10-2005, 03:41 AM
Hi there,

I think that "id" are unique for your entire application, so you couldn't use same id name ...

dheon09
11-29-2005, 12:01 AM
try applying 'clip="true"' on the parent view of the text..so all components under the view with a clip attribute becomes invicible...

spoco2
12-11-2005, 04:23 PM
Hi,

On taking your view, and setting its visibility to false, everything does dissapear for me. (make sure you use 'wizTxt.setVisible(false)' or I think setAttribute('visible',false) works too, just make sure you don't quote the false (as 'false' or "false") as that doesn't work.

One thing that you have noted correctly is that non True Type rendered fonts do not respond to opacity settings... you have to give them a font.

Specify a font as such:
<font name="Swiss">
<face src="swiss_light.ttf" style="plain"/>
<face src="swiss_med.ttf" style="bold"/>
</font>

using any old true type font you like (just make sure it's in the fonts directory of Laszlo server). Now, apply it to your view(the text within the view will inherit it) as:
<view id="wizTxt" width="${parent.width}" height="${parent.height}" bgcolor="red" font="Swiss" visible="true">
<text name="testTxt" x="10" y="10" width="${parent.width - 20}" height="${parent.height - 20}" multiline="true">
<p>Some text.</p>
<p>Some more text.</p>
</text>

<view x="${parent.width - 230}" y="${parent.height - 40}">
<checkbox x="12" id="dontShow" text="skip this next time" value="false"/>
<button height="20" text="continue" onclick="wizImg.bending_move.doStart()" />
<simplelayout axis="x" spacing="12"/>
</view>
</view>


And now the text will respond to opacity commands.

(Use another font than above, that's just what we're using in our code, a lot do come with Laszlo)