UI/Frame Types/TextFormatFrame

From SC2Mapster Wiki
Jump to: navigation, search


This is utility frame, that doesn't display anything by itself. It's purpose is to assemble a text, from a list of tokens provided in Replacement list, using a pattern specified in FormatText.

Assembled text is stored in a Text property (read-only). Which can be bound to property of another frame, such as Text in Label.



TextFormatFrame Properties

TextFormatFrame inherits from Frame and shares all of its properties. Additionally it has:

This value contains a string of text with marks (%#%) of indexes for string replacement.

This value contains a string of text.

This value contains a string of text to replace an index in a FormatText string (%#%) with.

This value is the number of replacements required for the FormatText to be displayed, otherwise the Text field will be left blank.


<Frame type="TextFormatFrame" name="TestTextFrame">
	<Anchor relative="$parent" />
	<FormatText val="Testing Testing %0% %1% %2% ..."/>
	<Replacement index="0" val="A"/>
	<Replacement index="1" val="B"/>
	<Replacement index="2" val="C"/>
<Frame type="TextFormatFrame" name="ShieldsText">
    <Anchor relative="$parent"/>
    <FormatText val="%0% / %1%"/>
    <Replacement val="{$parent/HealthValues/@Shields}" index="0"/>
    <Replacement val="{$parent/HealthValues/@MaxShields}" index="1"/>
<Frame type="Label" name="FenixCurrentShields">
    <Text val="{$parent/ShieldsText/@Text}"/>