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
isRemoved()
Returns true if the Label is removed, false if not.
Returns
boolean true if Label is removed, false if not
opacity()
Returns the opacity of the label. Ranges from 0 (invisible) to 255 (fully opaque)
Returns
number the opacity of the label
position()
Returns the position of the label.
Returns
Vec2 the {x, y} position of the label.
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
setOpacity(value)
Sets the opacity of the label. Ranges from 0 (invisible) to 255 (fully opaque)
Parameters
number value – The opacity of the label
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)
setText(value)
Sets the text for the label.
Parameters
string value – The string that will be displayed by the label.