Creates a Texture object within the specified widget.
texture = Frame:CreateTexture(["name"[, "layer"[, "inheritsFrom"[, subLayer]]]])
This method is available on any widget inheriting from Frame.
- String - Name of the newly created texture; the function will create a global variable mapping this value to the created texture. If nil, the texture is anonymous and no global variable is created.
- String - The layer to the texture should be drawn in, e.g. "ARTWORK".
- String - a comma-delimited list of names of virtual textures (created in XML) to inherit from; if nil, the texture does not inherit any properties.
- Number - The order in which the texture should be drawn, within the same layer.
The following snippet creates a semi-transparent white background within a frame:
-- assume frame is a Frame local tex = frame:CreateTexture(nil, "BACKGROUND") tex:SetAllPoints() tex:SetColorTexture(1, 1, 1, 0.5)