Text script interface
The ITextInstance
interface derives from IWorldInstance to add APIs specific to the Text plugin.
Text APIs
- text
- The string currently displayed by the Text object.
- typewriterText(str, duration)
- Set the text over time by starting with an empty string and gradually adding characters until the full text of
str
is written out, over a duration
specified in seconds. Note modifying the text
property while text is being written out will cancel the effect.
- typewriterFinish()
- If text is being written out with the
typewriterText()
method, force it to finish immediately.
- fontColor
- An array with 3 elements specifying the red, green and blue color of the text, with color values as floats in the 0-1 range.
- fontFace
- A string specifying the font used to display the text, e.g. "Arial".
- isBold
- isItalic
- Booleans indicating whether the font face is displayed with bold or italic styles.
- sizePt
- The size of the displayed text, in points (pt).
- lineHeight
- The extra space in pixels to add vertically between lines. 0 is the default size, negative values make lines closer together, and positive values space lines out further apart.
- horizontalAlign
- A string specifying the horizontal alignment of the text within the object bounding box, which must be one of
"left"
, "center"
or "right"
.
- verticalAlign
- A string specifying the vertical alignment of the text within the object bounding box, which must be one of
"top"
, "center"
or "bottom"
.
- wordWrapMode
- A string specifying the way to wrap text when it reaches the end of a line. This can be either
"word"
to wrap entire space-separated words, or "character"
to wrap at any character.
- textWidth
- textHeight
- Read-only values indicating the size of the actual text content within the text object's rectangle.
Construct 3 Manual
Construct.net
2019-06-03
2021-10-19
You are here:
Search this manual:
This manual entry was last updated on 19 Oct, 2021 at 14:34