WoW:API Frame CreateTexture: Difference between revisions

Removed stub warning for aethestics, feel free to re-add if this article doesn't grow
(→‎Usage: NOTE The game will not find image files that did not exist when it was started, you may need to restart the game for the texture to appear.)
(Removed stub warning for aethestics, feel free to re-add if this article doesn't grow)
Line 1: Line 1:
{{Stub/API}}
{{widgetmethod}}
{{widgetmethod}}


Creates a new texture for the frame.
'''CreateTexture''' is a method on [[UIObject_Frame|Frame]] objects that creates and returns a new [[UIObject_Texture|Texture]]. CreateTexture allows Lua to create textures that would otherwise only be available to XML. This method also lets developers the option to reuse virtual textures declared in XML.


   Frame:CreateTexture(["textureName"[, "layer"]][, "inheritsFrom"])
   Frame:CreateTexture(["textureName"[, "layer"]][, "inheritsFrom"])


== Parameters ==
== 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.
:;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.
Line 20: Line 18:
  FRAME.texture:[[API Texture SetTexture|SetTexture]](r,g,b[,a])
  FRAME.texture:[[API Texture SetTexture|SetTexture]](r,g,b[,a])


NOTE The game will not find image files that did not exist when it was started, you may need to restart the game for the texture to appear.
The game will not find image files that did not exist when it was started, so you may need to restart the game for the texture to appear.
Anonymous user