Wikia

WoWWiki

Changes: XML/Attribute

Edit

Back to page

m (Attributes)
m (Attributes)
Line 11: Line 11:
 
== Attributes ==
 
== Attributes ==
 
* name (string) - Lua name for the attriute
 
* name (string) - Lua name for the attriute
* type ([[XML/ATTRIBUTETYPE|ATTRIBUTETYPE) - the Lua type for the attribute. Default is 'string'.
+
* type ([[XML/ATTRIBUTETYPE|ATTRIBUTETYPE]]) - the Lua type for the attribute. Default is 'string'.
 
* value - the actual value for the attribute. will be converted to the Lua type defined by type at runtime
 
* value - the actual value for the attribute. will be converted to the Lua type defined by type at runtime
   

Revision as of 06:45, September 19, 2013

XML UI ← XML types < Attribute

The WoW XML Attribute elements add an arbitrary variable to a runtime Lua object. This mechanism is very akin to the parentKey, relativeKey, and targetKey XML attributes, in that all of these allow adding arbitrary member variables to Lua objects from WoW FrameXML.

Inheritance

Inherited by: none, Inherits: none, Defined in: Frame > Attributes

Elements

none

Attributes

  • name (string) - Lua name for the attriute
  • type (ATTRIBUTETYPE) - the Lua type for the attribute. Default is 'string'.
  • value - the actual value for the attribute. will be converted to the Lua type defined by type at runtime

Summary

An Attribute element defines a Lua runtime object varible for the XML element.

Example

<Frame name="MyFrame">
  <Attributes>
    <Attribute name="myvar" type="number" value="0"/>
  </Attributes>
</Frame>

This example will set a variable named 'myvar' with a number value of '0', when the frame is created.

Around Wikia's network

Random Wiki