Label

Billboard text label.

Constructor

new Label(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsObject<optional>

Label options:

Properties
NameTypeAttributesDescription
positionVec3 | Array.<number><optional>

Billboard spatial position.

rotationnumber<optional>

Screen angle rotation.

colorVec4 | string | Array.<number><optional>

Billboard color.

alignedAxisVec3 | Array.<number><optional>

Billboard aligned vector.

offsetVec3 | Array.<number><optional>

Billboard center screen offset.

visibilityboolean<optional>

Visibility.

textstring<optional>

Text string.

facestring<optional>

HTML5 font face.

sizenumber<optional>

Font size in pixels.

stylestring<optional>

HTML5 font style. Example 'normal', 'italic'.

weightstring<optional>

HTML5 font weight. Example 'normal', 'bold'.

outlinenumber<optional>

Text outline size. 0 - no outline, 1 - maximum outline. Default 0.58.

outlineColorVec4 | string | Array.<number><optional>

Outline color.

alignstring<optional>

Text horizontal align: "left", "right" and "center".

Extends

Methods

assignFontAtlas(fontAtlas)

Assigns font atlas and update.

Parameters:
NameTypeDescription
fontAtlasFontAtlas

Font atlas.

getAlign() → {string}

Gets label text current alignment.

Returns:
Type: 
string

getAlignedAxis() → {Vec3}

Returns aligned vector.

Returns:
Type: 
Vec3

getColor() → {Vec4}

Returns RGBA color.

Returns:
Type: 
Vec4

getFace() → {string}

Gets current font face.

Returns:
Type: 
string

getOffset() → {Vec3}

Returns billboard screen space offset size.

Returns:
Type: 
Vec3

getOutline() → {number}

Gets text current outline size.

Returns:
Type: 
number

getOutlineColor() → {Vec4}

Gets outline color vector.

Returns:
Type: 
Vec4

getOutlineOpacity() → {number}

Gets outline opacity value.

Returns:
Type: 
number

getPosition() → {Vec3}

Returns billboard position.

Returns:
Type: 
Vec3

getRotation() → {number}

Gets screen space rotation.

Returns:
Type: 
number

getSize() → {number}

Gets label size in pixels.

Returns:
Type: 
number

getText() → {string}

Gets current text string.

Returns:
Type: 
string

getVisibility() → {boolean}

Returns billboard visibility.

Returns:
Type: 
boolean

remove()

Removes billboard from handler.

setAlign(align)

Sets label text align. Could be center, left or right. Left is default.

Parameters:
NameTypeDescription
alignstring

Text align.

setAlignedAxis(x, y, z)

Sets billboard cartesian aligned vector.

Parameters:
NameTypeDescription
xnumber

Aligned vector X coordinate.

ynumber

Aligned vector Y coordinate.

znumber

Aligned vector Z coordinate.

setAlignedAxis3v(alignedAxis)

Sets billboard aligned vector.

Parameters:
NameTypeDescription
alignedAxisVec3

Align direction.

setColor(r, g, b, a)

Sets RGBA color. Each channel from 0.0 to 1.0.

Parameters:
NameTypeDescription
rnumber

Red.

gnumber

Green.

bnumber

Blue.

anumber

Alpha.

setColor4v(color)

Sets RGBA color. Each channel from 0.0 to 1.0.

Parameters:
NameTypeDescription
colorVec4

RGBA vector.

setColorHTML(color)

Sets billboard color.

Parameters:
NameTypeDescription
colorstring

HTML style color.

setFace(face)

Sets font face family.

Parameters:
NameTypeDescription
facestring

Font face family.

setOffset(x, y, zopt)

Sets screen space offset.

Parameters:
NameTypeAttributesDescription
xnumber

X offset.

ynumber

Y offset.

znumber<optional>

Z offset.

setOffset3v(offset)

Sets screen space offset.

Parameters:
NameTypeDescription
offsetVec2

Offset size.

setOpacity(a)

Sets label opacity.

Parameters:
NameTypeDescription
anumber

Label opacity.

setOutline(outline)

Sets text outline border size. Where 0 - is no outline, and 1 - is the maximum outline size.

Parameters:
NameTypeDescription
outlinenumber

Text outline size.

setOutlineColor(r, g, b, a)

Sets text outline color.

Parameters:
NameTypeDescription
rnumber

Red.

gnumber

Green.

bnumber

Blue.

anumber

Alpha.

setOutlineColor4v(rgba)

Sets text outline color.

Parameters:
NameTypeDescription
rgbaVec4

Color vector.

setOutlineColorHTML(color)

Sets text outline color HTML string.

Parameters:
NameTypeDescription
colorstring

HTML string color.

setOutlineOpacity(opacity)

Sets outline opacity. Actually outline color alpha value.

Parameters:
NameTypeDescription
opacitynumber

Outline opacity.

setPickingColor3v(color)

Sets billboard picking color.

Parameters:
NameTypeDescription
colorVec3

Picking color.

setPosition(x, y, z)

Sets billboard position.

Parameters:
NameTypeDescription
xnumber

X coordinate.

ynumber

Y coordinate.

znumber

Z coordinate.

setPosition3v(position)

Sets billboard position.

Parameters:
NameTypeDescription
positionVec3

Cartesian coordinates.

setRotation(rotation)

Sets billboard screen space rotation in radians.

Parameters:
NameTypeDescription
rotationnumber

Screen space rotation in radians.

setRtl(isRTL)

Change text direction.

Parameters:
NameTypeDescription
isRTLboolean

Text string.

setSize(size)

Sets label font size in pixels.

Parameters:
NameTypeDescription
sizenumber

Label size in pixels.

setText(text)

Set label text.

Parameters:
NameTypeDescription
textstring

Text string. It can't be bigger than maximum labelHandler _maxLetters value.

setVisibility(visibility)

Sets billboard visibility.

Parameters:
NameTypeDescription
visibilityboolean

Visibility flag.

(async) update()

Updates label parameters.