View Single Post
04-19-11, 06:16 PM   #2
Monolit
A Black Drake
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 81
Originally Posted by Lordyfrb View Post
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)
  Reply With Quote