WoW:API Frame CreateTexture: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Parameters added) |
||
Line 1: | Line 1: | ||
{{Stub/API}} | {{Stub/API}} | ||
{{widgetmethod}} | {{widgetmethod}} | ||
Creates a new texture for the frame. | |||
Frame:CreateTexture(["textureName"[, "layer"]][, "inheritsFrom"]) | |||
== Parameters == | |||
=== Arguments === | |||
:;textureName : String - Name of the newly created texture. If nil, no name is assigned. The function will also set a global variable of this name to point to newly created texture. | |||
:;layer : String - The [[layer]] to use. | |||
:;inheritsFrom : String - a comma-delimited list of names of virtual frames to inherit from (the same as in XML). If nil, no frames will be inherited. These frames cannot be frames that were created using this function, they must be created using XML with '''virtual="true"''' in the tag. | |||
== Usage == | |||
Generally, either use the [[API Frame SetBackdrop|SetBackdrop]] function or use code similar to the following to set a solid color background: | |||
FRAME.texture = FRAME:CreateTexture() | FRAME.texture = FRAME:CreateTexture() | ||
FRAME.texture:SetAllPoints(FRAME) | FRAME.texture:SetAllPoints(FRAME) | ||
FRAME.texture:SetTexture(r,g,b[,a]) | FRAME.texture:SetTexture(r,g,b[,a]) |
Revision as of 21:08, 24 June 2008
← Widget API ← Frame < CreateTexture
Creates a new texture for the frame.
Frame:CreateTexture(["textureName"[, "layer"]][, "inheritsFrom"])
Parameters
Arguments
- textureName
- String - Name of the newly created texture. If nil, no name is assigned. The function will also set a global variable of this name to point to newly created texture.
- layer
- String - The layer to use.
- inheritsFrom
- String - a comma-delimited list of names of virtual frames to inherit from (the same as in XML). If nil, no frames will be inherited. These frames cannot be frames that were created using this function, they must be created using XML with virtual="true" in the tag.
Usage
Generally, either use the SetBackdrop function or use code similar to the following to set a solid color background:
FRAME.texture = FRAME:CreateTexture() FRAME.texture:SetAllPoints(FRAME) FRAME.texture:SetTexture(r,g,b[,a])