Thread: XML Anchors
View Single Post
02/19/15, 01:44 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
See picture here:
http://wiki.esoui.com/Control:SetAnchor

There is many ways how to do it, everything depends on how you want to handle parent control.

For example you can anchor first texture to the top left corner of parent control an then all other textures anchor to the first one:
XML Code:
  1. <Controls>
  2.   <Control name="$(parent)_Section">
  3.     <Controls>
  4.       <Texture name="$(parent)_Texture1" textureFile="something.dds">
  5.         <Anchor point="TOPLEFT" />
  6.         <Dimensions x="20" y="20" />
  7.       </Texture>
  8.       <Texture name="$(parent)_Texture2" textureFile="something.dds">
  9.         <Anchor point="TOPLEFT" relativeTo="$(parent)_Texture1" relativePoint="TOPRIGHT" />
  10.         <Dimensions x="20" y="20" />
  11.       </Texture>
  12.       <Texture name="$(parent)_Texture3" textureFile="something.dds">
  13.         <Anchor point="TOPLEFT" relativeTo="$(parent)_Texture1" relativePoint="BOTTOMLEFT" />
  14.         <Dimensions x="20" y="20" />
  15.       </Texture>
  16.       <Texture name="$(parent)_Texture4" textureFile="something.dds">
  17.         <Anchor point="TOPLEFT" relativeTo="$(parent)_Texture1" relativePoint="BOTTOMRIGHT" />
  18.         <Dimensions x="20" y="20" />
  19.       </Texture>
  20.     </Controls>
  21.   </Control>
  22. </Controls>

Another example could be anchoring to the center of parent control:
XML Code:
  1. <Controls>
  2.   <Control name="$(parent)_Section">
  3.     <Controls>
  4.       <Texture textureFile="something.dds">
  5.         <Anchor point="BOTTOMRIGHT" relativePoint="CENTER" />
  6.         <Dimensions x="20" y="20" />
  7.       </Texture>
  8.       <Texture textureFile="something.dds">
  9.         <Anchor point="BOTTOMLEFT" relativePoint="CENTER" />
  10.         <Dimensions x="20" y="20" />
  11.       </Texture>
  12.       <Texture textureFile="something.dds">
  13.         <Anchor point="TOPRIGHT" relativePoint="CENTER" />
  14.         <Dimensions x="20" y="20" />
  15.       </Texture>
  16.       <Texture textureFile="something.dds">
  17.         <Anchor point="TOPLEFT" relativePoint="CENTER" />
  18.         <Dimensions x="20" y="20" />
  19.       </Texture>
  20.     </Controls>
  21.   </Control>
  22. </Controls>

If you do not specify any anchor argument, it will use default. For example relativeTo will be "$(parent)", offsetX and offsetY will be "0".

Last edited by Garkin : 02/19/15 at 02:08 PM.
  Reply With Quote