TextRuntimeObject

TextRuntimeObject

Displays a text.

Constructor

new TextRuntimeObject(runtimeScene, textObjectData)

Parameters:
Name Type Description
runtimeScene

The scene the object belongs to.

textObjectData

The initial properties of the object

Source:

Methods

extraInitializationFromInitialInstance()

Initialize the extra parameters that could be set for an instance.

Source:

getCharacterSize()

Get the font size of the characters of the object.

Source:

getColor()

Get the text color.

Returns:
Type Description

The color as a "R;G;B" string, for example: "255;0;0"

Source:

getHeight()

Get height of the text.

Source:

getOpacity()

Get object opacity.

Source:

getPadding()

Get padding of the text object.

Returns:
Type Description

number of pixels around the text before it gets cropped

Source:

getScale()

Get scale of the text.

Source:

getScaleX()

Get x-scale of the text.

Source:

getScaleY()

Get y-scale of the text.

Source:

getString()

Get the string displayed by the object.

Source:

getTextAlignment()

Get the text alignment of text object.

Returns:
Type Description

The text alignment.

Source:

getWidth()

Get width of the text.

Source:

getWrappingWidth()

Get the word wrapping width for the text object.

Source:

isBold()

Return true if the text is bold.

Source:

isItalic()

Return true if the text is italic.

Source:

isWrapping()

Return true if word wrapping is enabled for the text.

Source:

setAngle(angle)

Set the angle of the object.

Parameters:
Name Type Description
angle

The new angle of the object

Source:

setBold(enable)

Set bold for the object text.

Parameters:
Name Type Description
enable boolean

true to have a bold text, false otherwise.

Source:

setCharacterSize(newSize)

Set the font size for characters of the object.

Parameters:
Name Type Description
newSize

The new font size for the text.

Source:

setColor(color)

Change the text color.

Parameters:
Name Type Description
color

color as a "R;G;B" string, for example: "255;0;0"

Source:

setFontName(fontResourceName)

Set the name of the resource to use for the font.

Parameters:
Name Type Description
fontResourceName

The name of the font resource.

Source:

setGradient(strFirstColor, strSecondColor, strThirdColor, strFourthColor, strGradientType)

Set the gradient for the text object.

Parameters:
Name Type Description
strFirstColor

color as a "R;G;B" string, for example: "255;0;0"

strSecondColor

color as a "R;G;B" string, for example: "255;0;0"

strThirdColor

color as a "R;G;B" string, for example: "255;0;0"

strFourthColor

color as a "R;G;B" string, for example: "255;0;0"

strGradientType

gradient type

Source:

setItalic(enable)

Set italic for the object text.

Parameters:
Name Type Description
enable boolean

true to have an italic text, false otherwise.

Source:

setOpacity()

Set object opacity.

Source:

setOutline(str, thickness)

Set the outline for the text object.

Parameters:
Name Type Description
str

color as a "R;G;B" string, for example: "255;0;0"

thickness

thickness of the outline (0 = disabled)

Source:

setPadding(value)

Set padding of the text object.

Parameters:
Name Type Description
value

number of pixels around the text before it gets cropped

Source:

setScale(newScale)

Set the text object scale.

Parameters:
Name Type Description
newScale

The new scale for the text object.

Source:

setScaleX(newScale)

Set the text object x-scale.

Parameters:
Name Type Description
newScale

The new x-scale for the text object.

Source:

setScaleY(newScale)

Set the text object y-scale.

Parameters:
Name Type Description
newScale

The new y-scale for the text object.

Source:

setShadow(str, distance, blur, angle)

Set the shadow for the text object.

Parameters:
Name Type Description
str

color as a "R;G;B" string, for example: "255;0;0"

distance

distance between the shadow and the text, in pixels.

blur

amout of shadow blur, in pixels.

angle

shadow offset direction, in degrees.

Source:

setString(str)

Set the string displayed by the object.

Parameters:
Name Type Description
str

The new text

Source:

setTextAlignment(alignment)

Set the text alignment for multiline text objects.

Parameters:
Name Type Description
alignment

The text alignment.

Source:

setWrapping(enable)

Set word wrapping for the object text.

Parameters:
Name Type Description
enable

true to enable word wrapping, false to disable it.

Source:

setWrappingWidth(width)

Set the word wrapping width for the text object.

Parameters:
Name Type Description
width

The new width to set.

Source:

setX()

Set object position on X axis.

Source:

setY()

Set object position on Y axis.

Source:

showShadow(enable)

Show the shadow of the text object.

Parameters:
Name Type Description
enable

true to show the shadow, false to hide it

Source: