Thread Tools Display Modes
06/19/14, 09:51 AM   #1
niocwy
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 11
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.

Last edited by niocwy : 06/19/14 at 11:52 AM.
  Reply With Quote
06/19/14, 06:05 PM   #2
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
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.
  Reply With Quote
06/19/14, 07:26 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
If you provide what you are actually doing that isn't working we can be of more help.
  Reply With Quote
06/20/14, 05:43 AM   #4
niocwy
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 11
Originally Posted by Sasky View Post
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.

Last edited by niocwy : 06/20/14 at 05:56 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Problem with SetGradientColors()


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off