UI/Frame Properties

From SC2Mapster Wiki
< UI
Jump to: navigation, search

Frame Properties[edit | edit source]

Most of the frame customization is done through frame properties, including its dimensions, colors, visibility, tooltips, etc.

General Usage[edit | edit source]

All the content items in this section are used inside a frame markup like this:

<Frame name="myCustomFrame">
  <myproperty attribute="1"/>
  <Visible val="true"/>
</Frame>

Property List[edit | edit source]

About UI item sizes and anchors[edit | edit source]

A UI objects size can be determined in one of three ways:

  1. Setting the objects size through use of height and width val contents
  2. Using anchors to determine it's size (Will only work if the size val for the selected set of sides is not set)
  3. A combination of the above

Ex 1:

<Frame type="Frame" name="myCustomFrame">

 <Width val="250"/>
 <Height val="250"/>

</Frame>

This would create a Frame item of the size 250x by 250y

Ex 2

       <Frame type="Image" name="CommandPanelBorder">
           <Anchor side="Top" relative="$parent/CommandPanel" pos="Min" offset="-26"/>
           <Anchor side="Bottom" relative="$parent/CommandPanel" pos="Max" offset="125"/>
           <Anchor side="Left" relative="$parent/CommandPanel" pos="Min" offset="-33"/>
           <Anchor side="Right" relative="$parent/CommandPanel" pos="Max" offset="32"/>
       </Frame>

This would create an image item that would stick out from the commandpanel by 26 on the top, 125 on the bottom, 33 from the left, and 32 from the right. This would adjust dynamically according to the size of the command panel.

Ex 3

           <Frame type="Image" name="VLine">
               <Width val="3"/>
               <Anchor side="Top" relative="$parent" pos="Min" offset="0"/>
               <Anchor side="Bottom" relative="$parent" pos="Max" offset="0"/>
               <Anchor side="Left" relative="$parent/CommandPanel" pos="Max" offset="0"/>
           </Frame>

This would create an image item that would 3 pixels wide, but extend from the top of it's parent item, all the way to the bottom, anchored to the far right of the command panel.