new SpriteText(text, maxWidth, color, opacity, options)
Sprite text based on https://github.com/Jam3/three-bmfont-text
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | Text to be displayed |
maxWidth |
number | Max width |
color |
number | Color in hexadecimal |
opacity |
number | Text opacity |
options |
object | Options to create text geometry |
- Source:
Methods
-
addText(text)
-
Add text mesh
Parameters:
Name Type Description textstring Text to be displayed - Source:
-
getLayout()
-
Get geometry layout
- Source:
Returns:
Text geometry layout- Type
- object
-
setBMFont(callback, font, texture)
-
Set BMFont
Parameters:
Name Type Description callbackfunction Callback after font is loaded fontobject The font to be loaded textureTHREE.Texture Font texture - Source:
-
setEntity(entity)
-
Set entity if multiple objects are considered as one entity
Parameters:
Name Type Description entityobject Entity represents whole group structure - Source:
-
tween(name, object, toState, duration, easing, delay, onStart, onUpdate, onComplete)
-
Create a tween object for animation based on - https://github.com/tweenjs/tween.js
Parameters:
Name Type Description namestring Name of the tween animation objectobject Object to be tweened toStateobject Final state of the object's properties durationnumber Tweening duration easingTWEEN.Easing Easing function delaynumber Animation delay time onStartfunction On start function onUpdatefunction On update function onCompletefunction On complete function - Source:
Returns:
- Tween object- Type
- TWEEN.Tween
-
update(options)
-
Update text geometry
Parameters:
Name Type Description optionsobject Geometry options based on https://github.com/Jam3/three-bmfont-text#geometry--createtextopt - Source: