Module: label

CS559 3D World Framework Code

Helpers for creating text sprite labels and attaching them to GrObjects.

Source:

Methods

(static) addLabelToGrObject(grObject, labelText, offsetopt) → {T.Sprite}

Create and add a label above a GrObject.

If offset is not provided, the y-offset is estimated from the object's bounding-box height.

Parameters:
Name Type Attributes Description
grObject GrObject
labelText string
offset T.Vector3 | number <optional>
Source:
Returns:
Type
T.Sprite

(static) makeLabel(text) → {T.Sprite}

Build a sprite label by drawing text to a canvas and using it as a texture.

Parameters:
Name Type Description
text string
Source:
Returns:
Type
T.Sprite