Table of Contents


Extends: Group 

Description

The ScrollingLabel node class provides an automatic way to make a string scroll horizontally if it does not fit within the specified width. If the string can be drawn within the specified maximum width it is just drawn. If it does not fit within the specified maximum width, it is drawn with an ellipsis (...) at the end, then it transitions to the full string, clipped to the maximum width that scrolls left to right until the end of the string is visible, then transition back to the partial string with the ellipsis at the end. By default, this repeats continuously unless the repeatCount field is set to limit the number of times the scrolling occurs.

Alignment

The ScrollingLabel node class uses the horizAlign and vertAlign fields to allow you to position the rendered text relative to a specified bounding rectangle. 

Horizontal Alignment

The horizAlign field allows you to position text horizontally relative to the maximum width of the label as specified by the maxWidth field.

There are three possible values for the horizAlign field:

Vertical Alignment

The vertAlign field allows you to position text vertically relative to the computed height of the label. The computed height is determined in one of two ways:

There are three possible values for the vertAlign field:

Fields

FieldTypeDefault Use
textstring""Specifies the text to be displayed.
colorcolor0xddddddffSpecifies the text color.
fontFontsystem defaultSpecifies the Font node to be used.
maxWidthfloat500Specifies the maximum width of the rendered text. If the rendered text exceeds the maximum width, the scrolling behavior is automatically triggered.
heightfloat0Specifies the height of the label. If set to zero, the actual height is determined by the value of the numLines field if it is greater than zero. See Vertical Alignment.
scrollSpeedfloat100Specifies the horizontal scrolling speed in pixels per second
repeatCountfloat-1If set to the default value of -1, the text scrolling behavior repeats continuously. If set to zero, the text will remain ellipsized and never scroll. If set to a value greater than zero, the text will scroll the specified number of times, at the end of which the text is rendered with an ellipsis at the end.
horizAlignoption stringleftSee Horizontal Alignment.
vertAlign

option string

topSee Vertical Alignment.