XML / LayoutFrame LayoutFrame is a base type used as a fundamental UI building block for defining UI screen layout . The LayoutFrame type can be used for Size , Position and Animation , and provides a base type for Texture , FontString , Frame , and others . Used as the TitleRegion property . Inheritance . Inherited by : Frame , Texture , FontString , Inherits : none , Defined in : none Summary . LayoutFrame based elements facilitate the ' Layout ' mechanism in the WoW UI . When used with < Size > along with the « a href = " XML / Anchors " > Anchors < / a » element , allow WoW to position all of its visible and interactive elements on the screen , including the 3D views of the world . LayoutFrame works by providing a flexible set of size or positional constructs . Example . « a href = " XML / Frame " > Frame < / a > name = " MyFrameTemplate " hidden = " true " virtual = " true " / > This example will align the top of the ' child ' frame to the bottom of the FontString in ' MyFrame ' by using ' parentKey ' ' relativeKey ' references , and then offset that alignment by - 22 vertically . Also demonstrates use of Dimension with Size and Anchor , and using Abs and inline values , as well as use of ' $ parent ' to specify the name of the child where the child ' name ' will be ' MyFrameChild ' at runtime . Finally this example shows use of ' inherits ' and ' virtual ' where ' MyFrameTemplate ' is inherited by ' MyFrame ' causing ' MyFrame ' to inherit ' hidden ' from ' MyFrameTemplate ' making ' MyFrame ' hidden by default . Details . Names . Gets registered in the LUA global variables . Using the " $ parent " tag on a name refers to the parent ' s name - or the parent ' s parent ' s name , if the parent is unnamed , or even further up . For readability and errors avoiding it ' s strongly recommended to avoid same names with different letters . You can use " $ parent " inside name , this one will be replaced with parent attribute of element to form final name : gives out " MyFrameButton " name for element . When used without parent attribute it replaces with name of first named parent element . This needs for templates - if you use elements in template they will take name from real parent , not template one : will result in creation of element " RealFrame " with " RealFrameButton " inside it . If parent attribute undefined name of container of element used . Will create button named NamedFrameButton . Keys . Setting ' parentKey ' or ' parentArray ' will add a named Lua variable referencing this object to its parent object at runtime . Both can be used at the same time . Setting ' parentArray ' will add this object to a named array in its parent , and setting ' parentKey ' will create a simple Lua member to this object in the parent with that name . For ' parentKey ' conflicts , the last element loaded using the same key name on the same parent will be the one referenced . For ' parentArray ' , multiple elements with the same key name on the same parent will simply be added to the array . Inherited ' parentKey ' or ' parentArray ' values are not overridden as usual , but are additive . If a ' parentKey ' is set on both the inherited and inheriting element with different names , then both keys will be added to the parent and set to the same child . If multiple children in the same parent inherit the same template with a ' parentKey ' set in the template , then that key will be set to the last child to load . Likewise , a template with ' parentArray ' set would create or add to an array in the parent , in addition to whatever ' parentArray ' key may be set in the inheriting element , and elements can get added more than once if any up the inheritance chain are set to the same key . These behaviors can be both incredibly confusing , like code targeting wrong element , and incredibly convenient , like adding all children to an array using one attribute in one template . For Anchor s within XML , ' parentKey ' can be used with ' relativeKey ' , just like ' name ' and ' relativeTo ' are , to make an anchor point relative to another layout frame . Similarly must be prefixed to make it mean ' look in the parent ' , like ' $ parent . keyName ' including the ' . ' , to reference another child on the same parent . However , ' relativeKey ' by default references a key set on itself , rather than a global name like ' relativeTo ' does . With ' name ' based anchors : With ' key ' based anchors :