Ui XML Text - BLKTower/TestWiki GitHub Wiki

Table of Contents

A text frame, displays simple text. This frame type has a default size of 0 and expands to fit its text.

Example Usage

<Text text="Text Frame" />

This XML produces the following UI: image

Related Trigger Function(s):

A text frame

text

Value type: string

Supports data binding

Description

The text in the text frame.

Example Usage

<Text text="Text Frame" />

Related Trigger Function(s):

textExpression

Value type: string

Supports data binding

Description

The expression for the text in the text frame. Data bound values can be formatted to specific decimal values by appending the expression such as :F2. (You can find more documentation here). DreamEditor also provides an additional specifier :K to format huge numbers as "xxxK", "xxxM" or "xxxB". The default parameter for :K is :K2. When binding units or data, make sure to bind the data before creating the xml frame in lua. When binding units, the following properties are supported:

unit.Info.Icon
unit.Info.Name
unit.Health.Current
unit.Health.Max
unit.Health.Percentage
unit.Health.Fraction
unit.Health.Regeneration
unit.Shield.Current
unit.Shield.Max
unit.Shield.Percentage
unit.Shield.Fraction
unit.Shield.Regeneration
unit.Mana.Current
unit.Mana.Max
unit.Mana.Percentage
unit.Mana.Fraction
unit.Mana.Regeneration
unit.Ability.ability_name.CooldownRatio
unit.Ability.ability_name.MaxCharge
unit.Ability.ability_name.ChargeCount
unit.Expression.some_named_expression

Example Usage

<Text textExpression="{data.text}" />

Where {data.text} is declared and bound in lua before the text frame is created:

local data = {text = "Text Frame"}
DCEI.BindData("data", data)
local xml = DCEI.NewUiFromXml(DCEI.GetUiRoot(), "text")

Related Trigger Function(s):

translationKey

Value type: string

Supports data binding

Description

The translation key for the text frame. This uses a translation key declared in the data editor (Localization tab) to display text across different languages.

Example Usage

<Text translationKey="key" />

Related Trigger Function(s):

  • None.

fontSize

Value type: number

Supports data binding

Description

The font size for the text frame.

Example Usage

<Text text="Text Frame" fontSize="40" />

Related Trigger Function(s):

fontSizeMin

Value type: number

Supports data binding

Description

The minimum font size for the text frame. Does not work if there is a set font size.

Example Usage

<Text text="Text Frame" fontSizeMin="40" />

Related Trigger Function(s):

fontSizeMax

Value type: number

Supports data binding

Description

The maximum font size for the text frame. Does not work if there is a set font size.

Example Usage

<Text text="Text Frame" fontSizeMax="60" />

Related Trigger Function(s):

color

Value type: color

Description

The font color for the text frame.

Example Usage

<Text text="Text Frame" fontSize="40" color="r: 1, g: 0, b: 0, a: 1" />

Related Trigger Function(s):

outline

Value type: boolean

Supports data binding

Description

The status of the text outline for the text frame, where true means the outline is enabled. This is true by default.

Example Usage

<Text text="Text Frame" fontSize="40" outline="false" />

Related Trigger Function(s):

shadow

Value type: boolean

Supports data binding

Description

The status of the text shadow for the text frame, where true means the shadow is enabled. This is true by default, disabling the text shadow will also disable the outline (even if otherwise enabled with outline="true").

Example Usage

<Text text="Text Frame" fontSize="40" shadow="false" />

Related Trigger Function(s):

wrapping

Value type: boolean

Supports data binding

Description

The status of the text wrapping for the text frame, where true means the wrapping is enabled. Wrapping will make the text automatically create new lines if the text would overflow the size of the frame; disabling text wrapping will force the text to display on one line. This is true by default, disabling text wrapping will cause the text to overflow if it is enabled.

Example Usage

<Frame backgroundImageColor="r: 0, g: 0, b: 0, a: 0.6">
    <Text width="150" text="Text Frame" fontSize="40" wrapping="false" />
</Frame>

Related Trigger Function(s):

rtlSupport

Value type: boolean

Supports data binding

Description

The status of the text RTL support (right to left text) for the text frame, where true means RTL support is enabled. This property is for text that is written right to left, such as Arabic.

Example Usage

<Text rtlSupport="true" />

Related Trigger Function(s):

alignment

Value type: string

Supports data binding

Description

The alignment of the text inside the text frame. Possible values:

start, end, top, bottom, (top|bottom)-(start|end)

Example Usage

<Frame backgroundImageColor="r: 0, g: 0, b: 0, a: 0.6">
    <Text width="400" text="Text Frame" fontSize="40" alignment="end" />
</Frame>

Related Trigger Function(s):

overflow

Value type: boolean

Supports data binding

Description

The status of the text overflow for the text frame, where true means the text will overflow the frame. This is true by default. Text will only overflow if it exceeds the height and width for the text frame. If the text size would exceed the frame size in both height and width, then no text will be displayed at all.

Example Usage

<Frame backgroundImageColor="r: 0, g: 0, b: 0, a: 0.6">
    <Text height="40" width="150" text="Text Frame" fontSize="40" overflow="false" />
</Frame>

Related Trigger Function(s):

outsideOutline

Value type: boolean

Supports data binding

Description

The status of the frame outline for the text frame, where true means the outline will be shown. This is false by default.

Example Usage

<Text text="Text Frame" fontSize="40" outsideOutline="true" />

Related Trigger Function(s):

outlineColor

Value type: color

Description

The text outline color for the text frame.

Example Usage

<Text text="Text Frame" fontSize="40" outlineColor="r: 1, g: 0, b: 0, a: 1" />

Related Trigger Function(s):

outlineWidth

Value type: number

Description

The text outline width for the text frame, scaled from 0-1. A value of -1 will disable the outline.

Example Usage

<Text text="Text Frame" fontSize="40" outlineColor="r: 1, g: 0, b: 0, a: 1" outlineWidth="0.5" />

Related Trigger Function(s):

outlineSoftness

Value type: number

Description

The text outline softness for the text frame, scaled from 0-1.

Example Usage

<Text text="Text Frame" fontSize="40" outlineColor="r: 1, g: 0, b: 0, a: 1" outlineSoftness="0.3" />

Related Trigger Function(s):

shadowWidth

Value type: number

Description

The text shadow width for the text frame, scaled from 0-1. A value of -1 will remove the shadow without removing the outline.

Example Usage

<Text text="Text Frame" fontSize="40" outlineColor="r: 1, g: 0, b: 0, a: 1" shadowWidth="-1" />

Related Trigger Function(s):

shadowSoftness

Value type: number

Description

The text shadow softness for the text frame, scaled from 0-1.

Example Usage

<Text text="Text Frame" fontSize="40" outline="false" shadowSoftness="0.3" />

Related Trigger Function(s):

shadowColor

Value type: color

Description

The text shadow color for the text frame.

Example Usage

<Text text="Text Frame" fontSize="40" shadowColor="r: 1, g: 0, b: 0, a: 1" outline="false" />

Related Trigger Function(s):

shadowDirection

Value type: vector2

Description

The text shadow direction for the text frame. The coordinate's direction is based on the unit circle. The default direction is (0, -1).

Example Usage

<Text text="Text Frame" fontSize="40" outline="false" shadowDirection="x: 1, y: 1" />

Related Trigger Function(s):

⚠️ **GitHub.com Fallback** ⚠️