Build some text that can be rendered
Should the text be centered at the rigid body's (cx,cy) (true) or is the rigid body's (cx,cy) top-left (false)?
Color for the text (should be an RGB string code, like #aa4433)
Name of the font to use
OptionallineHeight?: numberLine height, as a multiple of font size (optional, default 1.25)
Optionaloffset?: JLOffsetAn offset between the component's center and its RigidBody's center (optional)
Font size
OptionalstrokeColor?: stringThe color of the text outline (optional)
OptionalstrokeWidth?: numberThe width of the text outline (optional)
OptionalwrapWidth?: numberIf provided, the text word-wraps onto multiple
lines so that it stays within this many meters of
width (optional). Lines are centered if center
is true, and left-aligned otherwise.
Optionalz?: 0 | 1 | 2 | 4 | -4 | 3 | -3 | -2 | -1An optional z index in the range [-4,4] (default 0)
A function that creates the text to display, or a String
OptionalactorThe Actor to which this TextSprite is attached
Should the text be centered at X,Y (true) or is (X,Y) top-left (false)
Height of the text (computed)
An offset between the TextSprite's center and the RigidBody's center
A function that creates the text to display, or a String
ReadonlytextThe low-level text object that we pass to the Renderer
Width of the text (computed)
Z index of the image
Color for the text
Color for the text
The name of the font to use
The name of the font to use
Line height, as a multiple of font size
Line height, as a multiple of font size
Font size
Font size
Stroke color
Stroke color
Stroke width
Stroke width
Width, in meters, at which the text word-wraps onto multiple lines. If
undefined, the text never wraps. When wrapping, lines are centered if
center is true, and left-aligned otherwise.
Width, in meters, at which the text word-wraps (undefined = no wrap)
Return the width and height of the text
The camera of the scene where the text is being drawn
Some text whose size we're computing, since the object's real text might not be available yet
The width and height of the text, in meters
TextSprite describes any text object that can be drawn to the screen. The text that is displayed can be controlled by a callback, so that it can change over time.