View Single Post
01-02-16, 07:01 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Fizzlemizz View Post
Code:
frame.texture = CreateTexture("$parent_Texture")
frame.texture:SetAllPoints(frame)
frame.texture:SetTexture(" ")
CreateTexture(), like CreateFontString(), is a metamethod of frames. As such, you need to call it as Frame:CreateTexture(). Also, you need to specify a draw layer as the second argument. Names are optional and you can pass nil as the first argument to not assign one.



The reason why we need Textures and FontStrings to show frames is because they are the visual elements we see. Frames are just a set of coordinates defining a container that we can align Textures and FontStrings to. Some frame types can also react to mouse events within the screen coordinates they cover.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 01-02-16 at 07:05 PM.
  Reply With Quote