NoveltyML reference > Objects > Text

<Text>

An object for displaying texts. Supports both bitmap fonts and system fonts.


Set attributes

Attribute Description
font [Required] Font name
font-size Font size (System fonts only)
animation Animation mode
speed Animation speed
text Text content
fit Constrain text within size boundary
align-x Horizontal alignment
align-y Vertical alignment
bold Bold text (System fonts only)
italic Italic text (System fonts only)
ideal Ideal sizing (System fonts only)

Additionally, this asset type inherits all object attributes.


font [string] (Required)

Name of a valid Font resource or a system font.

Example:
font = "My font"
font = "Arial"


animation [integer]

An integer value that sets the animation mode.

Value Animation
0 None
1 Typewriter
2 Simple fade
3 Smooth fade

Example:
animation = "1"


speed [integer]

Value that determines how fast the characters appear when animation is enabled in characters per second.

Example:
speed = "25"


fit [bool]

When false, text object will resize based on its text content.
When true, the text content is constrained to within the object's size.

Example:
fit = "true"


align-x [string]

Sets horizontal text alignment. Default alignment is " left".

Value Alignment
"left" Left
"center" Center
"right" Right

Example:
align-x = "center"


align-y [string]

Sets vertical text alignment. Default alignment is "top".

Value Alignment
"top" Top
"center" Center
"bottom" Bottom

Example:
align-y = "bottom"


font-size [integer]

Font size. This attribute only applies when using a system font.

Example:
font-size = "16"


bold [bool]

Bold text. This attribute only applies when using a system font.

Example:
bold = "true"


italic [bool]

Italic text. This attribute only applies when using a system font.

Example:
italic = "true"


ideal [bool]

Enables ideal font sizing. This attribute only applies when using a system font.

When this attribute is true (default) the font size is determined by the scale of the object. This behavior ensures that the font is scaled appropriately when the game is played in other resolutions.

Example:
ideal = "true"


Valid child tags

Child tags Description
<Traits> Object traits list
<Meta> Meta information
Objects... Other objects


Example

<Text name="My text" font="My font" text="Hello" align-x="center" />

Back to top