Class: Label

Label(text, position, parent)

Text label somewhere in space: text plane with a texture. When horizontalAlignment is left, and autoAlign is true, display() method attempts to calculate X of the created plane, to align left edge of the plane to the given position. Otherwise, the position of the label is center of the text plane.

Constructor

new Label(text, position, parent)

Parameters:
Name Type Description
text label text
position Vector3 to put label at - center of the label, or left point if autoscaling is set.
parent optional parent node
Source:

Classes

Label

Members

autoAlign

Automatically align left - can't handle scaling yet
Source:

background

default none (null), may be "transparent", "white", "rgba(50,50,200,0.5)" etc
Source:

border

background border thickness, default 0 (no border)
Source:

color

text color, default white
Source:

cornerRadius

background corner radius, default 0
Source:

fontRatio

hack for calculating position/required texture size
Source:

fontRatio

hack for calculating position
Source:

height

Label height, default 1
Source:

horizontalAlignment

horizontal text alignment, default left
Source:

parent

Parent node
Source:

position

Label position
Source:

text

Label text
Source:

verticalAlignment

vertical text alignment, default top
Source:

Methods

display()

Display the label: create the TextBlock, Plane, AdvancedTexture.
Source:

setBackground()

Change background color after display()
Source:

setColor()

Change text color after display()
Source:

setText()

Set text after display()
Source: