Originally Posted by Lordyfrb
Hey guys, just wondering how to create gradients using LUA.
For example, I have a panel created using CreateFrame(), how can I make this panel fade from one side to another?
|
short answer:
SetGradientAlpha()
so in a nutshell, you just have to create a texture for your frame and then apply SetGradientAlpha method to it.
e.g.
local f = CreateFrame"Frame"
f.t = f:CreateTexture(nil, "PARENT")
f.t = SetTexture(some_texture or 1,1,1,1)
f.t:SetAllPoints(f)
f.t:SetGradientAlpha("HORIZONTAL", 0,0,0,1, 0,0,0,0)
f:SetWidth(some_width_value)
f:SetHeight(some_height_value)