ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Problem with SetGradientColors() (https://www.esoui.com/forums/showthread.php?t=1810)

niocwy 06/19/14 09:51 AM

Problem with SetGradientColors()
 
Hi everyone.

I'm trying to fade a texture control gradually, so decided to use :

Code:

SetGradientColors(integer orientation, number startR, number startG, number startB, number startA, number endR, number endG, number endB, number endA)
But it looks like the alpha parameters( startA and endA) are not taken into account, and I can't properly fade the texture. Anyone know why this is happenning ?

Or maybe this function is not supposed to work this way, but then I can't find a way to do what I want.

Sasky 06/19/14 06:05 PM

Haven't tried those. Only thing right off could be what the range for the alpha channel is on the transition.
If it's [0,1] and you treat as [0,100], it'll show as all on then off for example.

Seerah 06/19/14 07:26 PM

If you provide what you are actually doing that isn't working we can be of more help. ;)

niocwy 06/20/14 05:43 AM

Quote:

Originally Posted by Sasky (Post 9519)
Haven't tried those. Only thing right off could be what the range for the alpha channel is on the transition.
If it's [0,1] and you treat as [0,100], it'll show as all on then off for example.

It's using the [0,1] range.

I actually got it to work. The problem is not with the function, it works fine. Looks like there's two issues to consider here :

- first, if you're changing the alpha of a parent control using SetAlpha(), then the alpha values set by SetGradientColors() gets overriden.

- also, I was calling the function early in the initialization of my addon, but when I call it at runtime with zgoo, then it works. Considering I was doing this with a test control on which I didn't touch the alpha values of any parents on initialization, I guess that when the UI is loaded something must happen that changes the alpha of the control or its parent to 1.


All times are GMT -6. The time now is 02:02 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI