Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
 
No edit summary
 
Line 1: Line 1:
{{bp}}
+
{{widgetmethod}}
[[Image:Garrick Padfoot.jpg|frame|[[Garrick Padfoot]]]]
 
   
  +
'''CreateTexture''' is a method on [[XML/Frame|Frame]] objects that creates and returns a new [[XML/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.
'''Garrick Padfoot''' is a level 5 [[human]] found in [[Northshire Valley]] in [[Elwynn Forest]].
 
   
  +
Frame:CreateTexture(["textureName"[, "layer"]][, "inheritsFrom"])
Garrick is the local [[Defias]] leader, and is usually accompanied by a Defias Thug. His gang has taken over the [[Northshire Vineyards]] and uses it as a base for raids on the local farmers and merchants. [[Deputy Willem]] wants Garrick's head.
 
   
==Quests==
+
== Parameters ==
*{{Questlong|Alliance|5|Bounty on Garrick Padfoot}}
 
   
  +
:;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.
==Loot==
 
  +
:;layer : String - The [[layer]] to use.
*{{loot|Common|Garrick's Head}} ''(Quest Item)''
 
  +
:;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.
   
==External links==
+
== Usage ==
  +
Generally, either use the [[API Frame SetBackdrop|SetBackdrop]] function or use code similar to the following to set a solid color background:
<!-- Read http://www.wowwiki.com/WoWWiki:External_links before posting your links here.
 
Links that do not conform to the rules will be DELETED.
 
Repeat violations may result in a BAN.
 
Have a nice day. :) -->
 
{{elinks-NPC|103}}
 
   
  +
FRAME.texture = FRAME:CreateTexture()
{{DEFAULTSORT:Padfoot, Garrick}}
 
  +
FRAME.texture:[[API Frame SetAllPoints|SetAllPoints]](FRAME)
[[Category:Defias Brotherhood]]
 
  +
FRAME.texture:[[API Texture SetTexture|SetTexture]](r,g,b[,a])
[[Category:Humans]]
 
  +
[[Category:Named mobs]]
 
  +
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.
[[Category:Elwynn Forest mobs]]
 
[[Category:Quest targets]]
 

Revision as of 13:54, 11 January 2011

CreateTexture is a method on Frame objects that creates and returns a new 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"])

Parameters

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])

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.