The API is no longer being updated here until further notice. |
Creates a texture.
texture = Frame:CreateTexture([name, drawLayer, templateName, subLevel])
Arguments[]
- name
- string? - The global variable name that will be assigned, or
nil
for an anonymous texture. - drawLayer
- string? : DrawLayer - The layer the texture should be drawn in.
- templateName
- string? - Comma-delimited list of names of virtual textures (created in XML) to inherit from.
- subLevel
- number?
[-8, 7]
= 0
- The level of the sublayer if textures overlap.
Returns[]
- texture
- Texture🔗 - The new texture object as a child of this frame.
Example[]
Shows a semi-transparent yellow texture.
local f = CreateFrame("Frame", nil, UIParent)
f:SetPoint("CENTER")
f:SetSize(64, 64)
f.tex = f:CreateTexture()
f.tex:SetAllPoints()
f.tex:SetColorTexture(1, 1, 0, 0.5)
Patch history[]
Patch 1.11.0 (2006-06-19): Can now instantiate virtuals.