new Label(options)
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
Label options:
|
Extends
- BaseBillboard
Methods
-
assignFontAtlas(fontAtlas)
-
Assigns font atlas and update.
Name Type Description fontAtlas
utils.FontAtlas Font atlas. -
getAlign(){Label.ALIGN}
-
Gets label text current alignment.
Returns:
Type Description Label.ALIGN -
getFace(){string}
-
Gets current font face.
Returns:
Type Description string -
getOutline(){number}
-
Gets text current outline size.
Returns:
Type Description number -
getOutlineColor(){Vec4}
-
Gets outline color vector.
Returns:
Type Description Vec4 -
getOutlineOpacity(){number}
-
Gets outline opacity value.
Returns:
Type Description number -
getSize(){number}
-
Gets label size in pixels.
Returns:
Type Description number -
getText(){string}
-
Gets current text string.
Returns:
Type Description string -
setAlign(align)
-
Sets label text align. Could be center, left or right. Left is default.
Name Type Description align
Label.ALIGN Text align. -
setFace(face)
-
Sets font face family.
Name Type Description face
string Font face family. -
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
Vec4 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. -
setSize(size)
-
Sets label font size in pixels.
Name Type Description size
number Label size in pixels. -
setText(text)
-
Sets lablel text.
Name Type Description text
string Text string. It can't be bigger than maximum labelHandler _maxLetters value. -
asyncupdate()
-
Updates label parameters.