Anchoring

This is a guide for how to use the <Anchors> xml tag and how to use the WindowClearAnchors() and WindowAddAnchor() functions to dynamically reposition windows on the fly.

Summary
AnchoringThis is a guide for how to use the <Anchors> xml tag and how to use the WindowClearAnchors() and WindowAddAnchor() functions to dynamically reposition windows on the fly.
XML Defintion
Set Anchor on the flyYou can set anchor of a window on the fly in the lua code: The following code resets the window to current cursor position to show the “dragging” effect.

XML Defintion

As desciribed in the Window desciption, the anchor tag looks like

<Anchors>
<Anchor point="topright" relativePoint="bottomleft" relativeTo="">
<AbsPoint x="0" y="0" />
</Anchor>
</Anchors>

Set Anchor on the fly

You can set anchor of a window on the fly in the lua code: The following code resets the window to current cursor position to show the “dragging” effect.

WindowClearAnchors( windowName )
WindowAddAnchor( windowName, "topleft", "Root", "topleft", SystemData.MousePosition.x, SystemData.MousePosition.y+150)
Clears all of the anchors from the window.
Adds a new anchor to the window.
Window is the base level window definition.