Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:XML/Anchors
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Details == Anchors define position and size of a layout element relative to other layout frames. You can define one or more "anchor" tags within "anchors" element. Each anchor has several attributes: *Point ([[XML/FRAMEPOINT|FRAMEPOINT]]) - where the anchor is located on the element. Allowed values are: **TOP **BOTTOM **LEFT **RIGHT **CENTER (default) (notice not MIDDLE. Some addons use middle instead, but it's not supported at the moment) **TOPLEFT **BOTTOMLEFT **TOPRIGHT **BOTTOMRIGHT *RelativePoint - same as point, but defines not on this element but on its parent. Values are same as "Point". If undefined its value equals to "Point" *RelativeTo - by default is the parent element. you can specify another element to use instead with this attribute, giving a name as a value. *Offset - If point on element and point on its parent are separated between each other you need specify it with this tag. This is done normally by putting "AbsDimension" inside "Offset" tag with attributes "x" and "y". Bigger x - element goes right, bigger y - it goes top. If undefined it's taken as 0,0 If two or more anchors are defined they can override the size, so element size will depend on the size of its parent. Each widget got only four borders: *Horizontal type borders **Left **Right *Vertical type borders **Top **Bottom For each border type there are two ways of defining size and position: *'''By size and point'''<br />Element size remains unchanged, position is defined by 'hook' (anchor) on left, middle or right part of widget and fixed to left, middle or right part to another widget *'''Without size'''<br />Element size depends on position and size elements used to 'hook' element to. Distance between them increasing - this widget size too.<br />In this case you need one 'hook' for left border and one for right border. If undefined for both border types 'hook' is placed in center relative to its parent element center with zero offset and size equals to parent element size. Each anchor defined overrides one border rule. When 'hook' placed left or right it removes center 'hook'. When center 'hook' placed it removes 'left' and 'right' hooks if defined. Two borders type are separate, so horizontal size can be defined by one 'hook' and size, when vertical defined by two 'hooks'. TOPLEFT anchors should be processed as two anchors TOP anchor and LEFT anchor with all other properties same. Same for BOTTOMLEFT,TOPRIGHT,BOTTOMRIGHT. You can think about them just as shorter form of writing. CENTER anchor affects both border types. Widget can be relative only to one other element. So each anchor with relativeto attribute defined changes it. <PRE><Anchor point="LEFT"/></PRE>Will put 'hook' to left-middle part of widget and fix it to left-middle part of parent widget with zero offset <PRE><Anchor point="LEFT" relativepoint="TOPRIGHT"/></PRE>makes left part of widget fixed to right part of parent while top of parent will be middle of widget <PRE><Anchor point="TOPLEFT"/> <Anchor point="LEFT" relativeto="One"/></PRE>Widget top remains same as top of parent, when left of widget goes to left of "One" <PRE><Anchor point="RIGHT"/> <Anchor point="CENTER"/></PRE>Element will be fixed to center of its parent When element is inherited from another one and both got anchors defined, inherited processed first, then widget ones, so ones you override template anchors. For all this size is taken from [[XML_Properties#Size|Size]] tag. [[Category:XML elements]]
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)