Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Praivate on February 05, 2014, 10:35:43 PM
-
Hi !
I've encountered an issue with the TweenAlpha tool displayed by NGUI.
I have a TweenAlpha script attached to a Panel, with a Unlit/Transparent Colored shader. As a widget in this Panel I have a simple texture with a Unlit/Transparent Colored shader too.
The main idea is to have this texture fading in when the player goes under a certain amount of health, so I need to disable the Tween so it doesn't play at the start of the game, and to reactivate it later.
But when I disable the component by uncheking the box near the name of the script, the texture is still visible. The tween doesn't play anymore, so there's no fading in, but the texture is visible.
Is there something I don't understand with the utilisation of the TweenAlpha ? Maybe it doesn't work with a SimpleTexture widget ?
-
Does someone have an idea ?
-
What does a panel have to do with a shader? Not sure what you mean there.
Disabling the tween won't do anything other than pause the transition. If you want to hide something, set its alpha to 0.
-
Indeed...
Thank you ! I guess I've worked too much on my project and didn't even thought of this u_u
-
Hey !
I have an other issue with Tween Alpha now :
I have a UIPanel with the tween alpha script on it, and a texture attached to it. I've set the alpha of this texture to 0 to hide it at the beginning of the game, and my tween alpha is disabled for the same reason.
Now, I need to trigger the tween with code when a specific condition is true. I've got that with .Play, but there's something strange and I can't get it work properly :
1) With the settings I described, nothing happen : the tween doesn't trigger at start, the texture is invisible, but it doesn't change either when the .Play instruction is read.
2) If I set the alpha of the texture to 1 and enable the tween, the tween plays on start but doesn't play when the instruction is read and the texture is always visible.
3) If I set the alpha of the texture to 1 and disable the tween, then the tween is played properly by the script but the texture is always visible too.
Can't I just have the texture not visible at start, the tween not played at start but then played when called from my script ?
I'm pretty sure I'm missing something obvious but I just can't see what. Do you guys have any idea of what I'm doing wrong ?
-
Any idea ?
-
Likely related to one of the fixes in 3.5.0:
- FIX: Fixed an issue with how changing panel's alpha would not propagate to children in certain cases.
You can get around it by not attaching a tween. Use TweenAlpha.Begin(...) to start a tween on a target game object. The tween will be added for you.