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 text
string 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 callback
function Callback after font is loaded font
object The font to be loaded texture
THREE.Texture Font texture - Source:
-
setEntity(entity)
-
Set entity if multiple objects are considered as one entity
Parameters:
Name Type Description entity
object 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 name
string Name of the tween animation object
object Object to be tweened toState
object Final state of the object's properties duration
number Tweening duration easing
TWEEN.Easing Easing function delay
number Animation delay time onStart
function On start function onUpdate
function On update function onComplete
function On complete function - Source:
Returns:
- Tween object- Type
- TWEEN.Tween
-
update(options)
-
Update text geometry
Parameters:
Name Type Description options
object Geometry options based on https://github.com/Jam3/three-bmfont-text#geometry--createtextopt - Source: