Label Node

Function Description
globalDepth()

Returns the depth of the Label in a 2D World.

isRemoved() Returns true if the Label is removed, false if not.
opacity()

Returns the opacity of the label.

position()

Returns the position of the label.

setGlobalDepth(value)

Set the depth of the Label node in a 2D World.

setOpacity(value)

Sets the opacity of the label.

setPosition(x, y)

Sets the position of the label.

setText(value)

Sets the text for the label.


globalDepth()

Returns the global depth of the Label node. Depth decides which object is on top in a 2D World. A higher value will be above a lower number in the Scene.

Returns

number value – The global depth of the Label

↑ Back to top


isRemoved()

Returns true if the Label is removed, false if not.

Returns

boolean true if Label is removed, false if not

↑ Back to top


opacity()

Returns the opacity of the label. Ranges from 0 (invisible) to 255 (fully opaque)

Returns

number the opacity of the label

↑ Back to top


position()

Returns the position of the label.

Returns

Vec2 the {x, y} position of the label.

↑ Back to top


setGlobalDepth(value)

Sets the global depth of the Label node. Depth decides which object is on top in a 2D World. A higher value will be above a lower number in the Scene.

Parameters

number value – The global depth of the Label

↑ Back to top


setOpacity(value)

Sets the opacity of the label. Ranges from 0 (invisible) to 255 (fully opaque)

Parameters

number value – The opacity of the label

↑ Back to top


setPosition(x, y)

Sets the position of the label.

Parameters

number x – the x coordinate position
number y – the y coordinate position
number z – the z coordinate position (optional)

↑ Back to top


setText(value)

Sets the text for the label.

Parameters

string value – The string that will be displayed by the label.

↑ Back to top

Did you find this page useful?

Please give it a rating:

Please provide some feedback!

This is very helpful to us.

Tell us how we can improve this post?