API Referencegraphite
Text
UI text rendered with a font, color, screen position, and optional style.
Module: graphite
UI text rendered with a font, color, screen position, and optional style.
Declaration
export class Text extends UIObject { ... }Extends: UIObject
Constructors
constructor();constructor(
text: string,
font: Font,
color: Color,
position: Position2d,
);Properties
content
content: string;font
font: Font;position
position: Position3d;fontSize
fontSize: number;color
color: Color;Methods
getSize
Returns the current dimensions.
override getSize(): Size2d;getScreenPosition
Returns the UI element's screen-space position.
override getScreenPosition(): Position2d;setScreenPosition
Sets the UI element's screen-space position.
override setScreenPosition(position: Position2d): void;style
Returns the element's style.
style(): UIStyle;setStyle
Applies a style to the element.
setStyle(style: UIStyle): Text;setFontSize
setFontSize(size: number): Text;