The API is no longer being updated here until further notice. |
<LayoutFrame> abstracts tags and attributes common to most widgets.
<LayoutFrame name="" parentKey= "" parentArray="" inherits="" mixin="" secureMixin="" virtual="" setAllPoints="" hidden=""> <Size /> <Anchors /> <KeyValues /> <Animations /> </LayoutFrame>
Attributes[]
- References
- name (xs:string? ) - Adds a reference to _G, substituting
$parent
with a parent's name. - parentKey (xs:string? ) - Adds a reference to the widget's parent.
- parentArray ((xs:string? ) - Inserts a reference to an array in the widget's parent.
- Templates
- inherits (xs:string? ) - Inherits a comma-separated list of XML virtual templates.
- virtual (xs:boolean? ) - Creates an XML virtual template instead of a widget (requires name).
- mixin (xs:string? ) - Inherits a comma-separated list of Lua mixins.
- secureMixin (xs:string? ) - Inherits a comma-separated list of Lua mixins, wrapping inherited functions to force secure execution.
- Position & Visibility
- setAllPoints (xs:boolean? ) - Sets the top-left and bottom-right anchors to match the parent widget.
- hidden (xs:boolean? ) - Controls the frame's initial visibility.
Children[]
<Anchors> defines a widget's anchors by enclosing <Anchor> tags.
<Anchor> defines a single point to align a <LayoutFrame>.
- point (ui:FRAMEPOINT) - Point to align.
- relativeTo (xs:string? ) - Another widget to align against (in _G).
- relativeKey (string? ) - Another widget to align against (sibling).
- relativePoint (ui:FRAMEPOINT? ) - Point on the other widget to align against (defaults to the same as point)
- x (xs:float? ) - Horizontal offset.
- y (xs:float? ) - Vertical offset.
<Size> (inherits from <Dimension>) sets the width and height.
<KeyValues> defines additional properties by enclosing <KeyValue> tags.
<KeyValue> assigns a single key/value pair to the widget's runtime table.
- key (xs:string) - Key in the widget's table.
- value (xs:string) - Value to be assigned.
- keyType (ui:KEYVALUETYPE) - nil, boolean, number, string (default) or global
- type (ui:KEYVALUETYPE) - nil, boolean, number, string (default) or global
<Animations> encloses one or more <AnimationGroup> tags.
Example[]
The following example uses <Frame> to demonstrate <LayoutFrame>'s utility
- Creating (virtual) and using (inherits) XML virtual templates
- Extending a parent's name (name = "$parent____")
<Frame name="ContainerChildTemplate" virtual="true">
<!-- insert stuff here -->
</Frame>
<Frame name="Container">
<Frames>
<Frame name="$parentChild1" inherits="ContainerChildTemplate" /> <!-- name="ContainerChild1" -->
<Frame name="$parentChild2" inherits="ContainerChildTemplate" /> <!-- name="ContainerChild2" -->
</Frames>
</Frame>
Extending the example, two more frames could be added to "Container" during runtime using Lua:
CreateFrame("Frame", "ContainerChild3", "Container", "ContainerChildTemplate");
CreateFrame("Frame", "ContainerChild4", "Container", "ContainerChildTemplate");
See also[]
- Nearest Lua equivalent: Region.
- XML tags inheriting <LayoutFrame>: <Frame>, <Texture>, <FontString>.