Module textfield

Text field related variables and functions.

Functions

destroy () Destroys the text field.
getBounds () Returns the bounds of the text field as a Rectangle, relative to itself.
getRect () Returns the bounds of the text field as a Rectangle, relative to itself, excluding any strokes on shapes.

Fields

x The x position, in pixels, of the text field when it is the child of a sprite.
y The y position, in pixels, of the text field when it is the child of a sprite.
scaleX The horizontal scale of the text field when it is the child of a sprite.
scaleY The vertical scale of the text field when it is the child of a sprite.
scaleY The vertical scale of the text field when it is the child of a sprite.
rotation The rotation of the text field, in degrees, when it is the child of a sprite.
alpha The alpha of the text field, represented by a number in the range of 0 - 1.
redMultiplier A number value that is multiplied with the red color channel when drawn.
greenMultiplier A number value that is multiplied with the green color channel when drawn.
blueMultiplier A number value that is multiplied with the blue color channel when drawn.
colorMultiplier Sets red, green, and blue multipliers based on a hexadecimal RGB value (e.g.
alphaOffset A number value from -255 to 255 that is added to the alpha channel after it is multiplied by alpha.
redOffset A number value from -255 to 255 that is added to the alpha channel after it is multiplied by redMultiplier.
greenOffset A number value from -255 to 255 that is added to the alpha channel after it is multiplied by greenMultiplier.
blueOffset A number value from -255 to 255 that is added to the alpha channel after it is multiplied by blueMultiplier.
blendMode The blend mode of the text field.
destroyed Whether or not the text field was destroyed.
text The text within the text field.
width Text field width in pixels.
height Text field height in pixels.
size Size of the text.
color RGB color of the text.
align Text alignment mode.
wordWrap Whether the text automatically wraps around or not.
underline Whether the text is underlined or not.
autoSize Text auto-sizing mode.


Functions

destroy ()
Destroys the text field.
getBounds ()
Returns the bounds of the text field as a Rectangle, relative to itself.

Returns:

    Rectangle The bounds of the text field
getRect ()
Returns the bounds of the text field as a Rectangle, relative to itself, excluding any strokes on shapes.

Returns:

    Rectangle The bounds of the text field

Fields

x
The x position, in pixels, of the text field when it is the child of a sprite. By default 0.
y
The y position, in pixels, of the text field when it is the child of a sprite. By default 0.
scaleX
The horizontal scale of the text field when it is the child of a sprite. By default 1.
scaleY
The vertical scale of the text field when it is the child of a sprite. By default 1.
scaleY
The vertical scale of the text field when it is the child of a sprite. By default 1.
rotation
The rotation of the text field, in degrees, when it is the child of a sprite. By default 0.
alpha
The alpha of the text field, represented by a number in the range of 0 - 1. An alpha of 0 means the text field is completely transparent; 1 means fully visible. By default 1.
redMultiplier
A number value that is multiplied with the red color channel when drawn. By default 1.
greenMultiplier
A number value that is multiplied with the green color channel when drawn. By default 1.
blueMultiplier
A number value that is multiplied with the blue color channel when drawn. By default 1.
colorMultiplier
Sets red, green, and blue multipliers based on a hexadecimal RGB value (e.g. 0xFF0000). Write-only.
alphaOffset
A number value from -255 to 255 that is added to the alpha channel after it is multiplied by alpha. By default 0.
redOffset
A number value from -255 to 255 that is added to the alpha channel after it is multiplied by redMultiplier. By default 0.
greenOffset
A number value from -255 to 255 that is added to the alpha channel after it is multiplied by greenMultiplier. By default 0.
blueOffset
A number value from -255 to 255 that is added to the alpha channel after it is multiplied by blueMultiplier. By default 0.
blendMode
The blend mode of the text field. Use BlendMode enum values. By default BlendMode.NORMAL.

See also:

destroyed
Whether or not the text field was destroyed. Calling destroy sets this to true. Read-only.
text
The text within the text field.
width
Text field width in pixels. Setting this disables auto sizing if word wrap is also disabled.
height
Text field height in pixels. Setting this disables auto sizing.
size
Size of the text.
color
RGB color of the text.
align
Text alignment mode. Use TextFormatAlign enum values. By default TextFormatAlign.LEFT.

See also:

wordWrap
Whether the text automatically wraps around or not.
underline
Whether the text is underlined or not. By default false.
autoSize
Text auto-sizing mode. Use TextFieldAutoSize enum values. By default TextFieldAutoSize.NONE.

See also:

generated by LDoc 1.5.0 Last updated 2025-12-17 05:13:02