From SC2Mapster Wiki
< UI(Redirected from UI/Special Terms And Symbols)
Jump to: navigation, search

Certain Frame properties allow the uses of references, be it either other Frames or external assets and localized content.

Frame Referencing[edit | edit source]

The element itself, useful for resetting anchors and targets in animations.
<Animation name="Clicked">
    <Event event="OnCLick" action="Reset,Play" frame="$this"/>
    <Controller name="Property_0" type="Property" end="Pause" property="Visible" frame="$this">
        <Key type="Property" time="0" value="false"/>
Refers to a children of the current frame.
<anchor relative="ChildName"/>
The parent of the object this is listed in. This reference can be chained to refer to the higher levels in the frame hierarchy.
<anchor relative="$parent"/>
The root element which is the parent frame of all layout files. Its usage is not required. Seems to be used for dynamic instancing.
<HoverImage val="$root/StandardTemplates/StandardListBoxItemSelectedImage"/>
Refers to the closest parent frame with a specified type, e.g. "CommandPanel". @name can be used instead of @type to compare the name and not the type to the specified identifier.
<anchor relative="$ancestor[@name=FullscreenUpperContainer]"/>
Used to reach directly a Frame with a Handle that matches the name regardless of its location in the frame hierarchy.
<anchor relative="$HandleName"/>
Nesting References
It is also possible to nest references starting from the current frame, in order to reach other frames.
<anchor relative="$Parent/$Parent/ChildName/ChildName"/>

Asset Reference[edit | edit source]

Frames that use assets like images, models and sounds, can use declarations in Assets.txt to access asset files. This permits the genericized use of localized assets and have multiple variations per race without having to declare different items for each of them.

Their notation is as follows:

Will use the asset file with said path within Assets.txt.
Will use an asset fail with said path suffixed by the current race id, and will default to the exact path in case there is not a race specific variation.

Here is an example of an Assets.txt file which is imported to Base.SC2Data/GameData/ in the import editor.

<Texture val="@UI/BorderTexture"/> <!-- Will always use Assets\Textures\MyBorder.dds -->
<!-- ... -->
<Texture val="@@UI/BorderTexture"/> <!-- Will use Assets\Textures\MyProtossBorder.dds if protoss, 
                                         Assets\Textures\MyZergBorder.dds if zerg, but will use
                                         Assets\Textures\MyBorder.dds if terran since there is no
                                         terran specific version of the asset declared -->

Constants[edit | edit source]

Description[edit | edit source]

If you want to use the same value over and over, but when changing you want to have it easy you can use constants.

Options[edit | edit source]

name = The name of the constant, when setting a value you can refer to this by using the name and prefixing a "#" to it. val = The value of the constant, when this constant is uses the value defined here.

Usage[edit | edit source]

<Constant name="InventoryButtonGap" val="-2"/>

<Anchor side="Right" relative="$parent/Button02" pos="Min" offset="#InventoryButtonGap"/>

Property Binding[edit | edit source]

Description[edit | edit source]

Property binding is used to bind a value to another value of the same type. Although there are cases where it works outside it's own type such as text.

Usage[edit | edit source]

<Text val="{$button/@PropertyWhateverItIsYouAreLookingAt}"/>