CS559 3D World Framework Code
Helpers for creating text sprite labels and attaching them to GrObjects.
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> |
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 |
Returns:
- Type
- T.Sprite