XML/Anchor

From Warcraft Wiki
< XML
Jump to navigation Jump to search

<Anchors> (child of <LayoutFrame>) defines a widget's anchors by enclosing <Anchor> tags. <Line> also introduces <StartAnchor> and <EndAnchor> with the same attributes as <Anchor>

<Anchors>
	<Anchor point="" relativeKey="" relativeTo="" relativePoint="" x="" y="">
		<Offset />
	</Anchor>
</Anchors>

Child elements

<Anchor> defines a single point to align a <LayoutFrame>.

point (ui:FRAMEPOINT) - Point to align.
relativeTo (xs:string?Optional. Could be nil.) - Another widget to align against (in _G).
relativeKey (string?Optional. Could be nil.) - Another widget to align against (sibling).
relativePoint (ui:FRAMEPOINT?Optional) - Point on the other widget to align against (defaults to the same as point)
x (xs:float?Optional. Could be nil.) - Horizontal offset in lieu of an <Offset> tag.
y (xs:float?Optional. Could be nil.) - Vertical offset in lieu of an <Offset> tag.

<Offset> inherits from <Dimension>

<Dimension> defines a dimension (size, offset, etc.) as x and y, or with a child element to specify the coordinate system.
x (xs:int?Optional. Could be nil.) - Horizontal distance affected by UI scaling; (+) right and (-) left.
y (xs:int?Optional. Could be nil.) - Vertical distance affected by UI scaling; (+) up and (-) down.

<AbsDimension> defines coordinates in scaling-dependent units (same as <Dimension>).

x (xs:int) - Horizontal distance affected by UI scaling; (+) right and (-) left.
y (xs:int) - Vertical distance affected by UI scaling; (+) up and (-) down.

<RelDimension> defines coordinates relative to the entire screen, where 0 and 1 are the edges.

x (xs:float) - Ratio of screen width, from left to right edges.
y (xs:float) - Ratio of screen height, from bottom to top edges.


Details

Patch changes

See also

References

 
  1. ^ 2016-07-19, UI.xsd, version 7.0.3.22267, near line 537, archived at Townlong-Yak
  2. ^ 2015-06-22, UI.xsd, version 6.2.0.20173, near line 393, archived at Townlong-Yak