Class: Label

og.Label

new og.Label(options)

Billboard text label.
Name Type Description
options Object optional Label options:
Name Type Description
position og.math.Vector3 | Array.<number> optional Billboard spatial position.
rotation number optional Screen angle rotaion.
color og.math.Vector4 | string | Array.<number> optional Billboard color.
alignedAxis og.math.Vector3 | Array.<number> optional Billboard aligned vector.
offset og.math.Vector3 | Array.<number> optional Billboard center screen offset.
visibility boolean optional Visibility.
text string optional Text string.
face string optional HTML5 font face.
size number optional Font size in pixels.
style string optional HTML5 font style. Example 'normal', 'italic'.
weight string optional HTML5 font weight. Example 'normal', 'bold'.
outline number optional Text outline size. 0 - no outline, 1 - maximum outline. Default 0.58.
outlineColor og.math.Vector4 | string | Array.<number> optional Outline color.
align og.Label.ALIGN optional Text horizontal align: "left", "right" and "center".

Extends

Members

static,readonlyog.Label.ALIGNnumber

Text align options.
Properties:
Name Type Default Description
left number og.Label.LEFT
right number og.Label.RIGHT
center number og.Label.CENTER

static,constantog.Label.CENTERnumber

static,constantog.Label.LEFTnumber

static,constantog.Label.RIGHTnumber

protected_alignedAxisog.math.Vector3

Cartesian aligned axis vector.

protected_colorog.math.Vector4

RGBA color.

protected_entityog.Entity

Entity instance that holds this billboard.

protected_handlerog.BillboardHandler

Handler that stores and renders this billboard object.

protected_handlerIndexnumber

Billboard handler array index.

protected_offsetog.math.Vecto3

Billboard center screen space offset. Where x,y - screen space offset and z - depth offset.

protected_positionog.math.Vector3

Billboard center cartesian position.

protected_rotationnumber

Screen space rotation angle.

protected_scalenumber

Billboard scale.

protected_visibilityboolean

Billboard visibility.

readonlyidnumber

Object unic identifier.

Methods

assignFontAtlas(fontAtlas)

Assigns font atlas and update.
Name Type Description
fontAtlas og.utils.FontAtlas Font atlas.
Gets label text current alignment.
Returns:
Type Description
og.Label.ALIGN
Returns aligned vector.
Returns:
Type Description
og.math.Vector3
Returns RGBA color.
Returns:
Type Description
og.math.Vector4

getFace(){string}

Gets current font face.
Returns:
Type Description
string
Returns billboard screen space offset size.
Returns:
Type Description
og.math.Vector3

getOutline(){number}

Gets text current outline size.
Returns:
Type Description
number
Gets outline color vector.
Returns:
Type Description
og.math.Vector4

getOutlineOpacity(){number}

Gets outline opacity value.
Returns:
Type Description
number
Returns billboard position.
Returns:
Type Description
og.math.Vector3
Gets screen space rotation.
Returns:
Type Description
number
Gets billboard scale.
Returns:
Type Description
number

getSize(){number}

Gets label size in pixels.
Returns:
Type Description
number

getStyle(){string}

Gets label font style.
Returns:
Type Description
string

getText(){string}

Gets current text string.
Returns:
Type Description
string

inherited getVisibility(){boolean}

Returns billboard visibility.
Returns:
Type Description
boolean

getWeight(){string}

Gets label font weight.
Returns:
Type Description
string
Removes billboard from hander.

setAlign(align)

Sets label text align. Could be center, left or right. Left is default.
Name Type Description
align og.Label.ALIGN Text align.

inherited setAlignedAxis(x, y, z)

Sets billboard cartesian aligned vector.
Name Type Description
x number Aligned vector X coordinate.
y number Aligned vector Y coordinate.
z number Aligned vector Z coordinate.

inherited setAlignedAxis3v(alignedAxis)

Sets billboard aligned vector.
Name Type Description
alignedAxis og.math.Vecto3 Vector to align.
Sets RGBA color. Each channel from 0.0 to 1.0.
Name Type Description
r number Red.
g number Green.
b number Blue.
a number Alpha.
Sets RGBA color. Each channel from 0.0 to 1.0.
Name Type Description
color og.math.Vector4 RGBA vector.
Sets billboard color.
Name Type Description
color string HTML style color.

setFace(face)

Sets font face family.
Name Type Description
face string Font face family.
Sets screen space offset.
Name Type Description
x number X offset.
y number Y offset.
z number optional Z offset.
Sets screen space offset.
Name Type Description
offset og.math.Vector2 Offset size.

setOpacity(a)

Sets label opacity.
Name Type Description
a number Label opacity.

setOutline(outline)

Sets text outline border size. Where 0 - is no outline and 1 - is the maximum outline size.
Name Type Description
outline number Text outline size.

setOutlineColor(r, g, b, a)

Sets text outline color.
Name Type Description
r number Red.
g number Green.
b number Blue.
a number Alpha.

setOutlineColor4v(rgba)

Sets text outline color.
Name Type Description
rgba og.math.Vector4 Color vector.

setOutlineColorHTML(color)

Sets text outline color HTML string.
Name Type Description
color string HTML string color.

setOutlineOpacity(opacity)

Sets outline opacity. Actually outline color alpha value.
Name Type Description
opacity number Outline opacity.

inherited setPickingColor3v(color)

Sets billboard picking color.
Name Type Description
color og.math.Vector3 Picking color.
Sets billboard position.
Name Type Description
x number X coordinate.
y number Y coordinate.
z number Z coordinate.

inherited setPosition3v(position)

Sets billboard position.
Name Type Description
position og.math.Vector3 Cartesian coordinates.
Sets billboard screen space rotation in radians.
Name Type Description
rotation number Screen space rotation in radians.
Sets billboard scale.
Name Type Description
scale number Scale.

setSize(size)

Sets label font size in pixels.
Name Type Description
size number Label size in pixels.

setStyle(style)

Sets font HTML5 style. It's can be Italic or Normal values.
Name Type Description
style string HTML5 font style.

setText(text)

Sets lablel text.
Name Type Description
text string Text string. It can't be bigger than maximum labelHandler _maxLetters value.

inherited setVisibility(visibility)

Sets billboard visibility.
Name Type Description
visibility boolean Visibility flag.

setWeight(weight)

Sets label font HTML5 weight style. It's can be bold or normal.
Name Type Description
weight string HTML5 font weight style.
Updates label parameters.