Interface ITextOptions

interface ITextOptions {
    antialias?: boolean;
    color?: string;
    fontFamily?: string;
    fontSize?: number;
    text: string;
    textAlign?: CanvasTextAlign;
    textBaseline?: CanvasTextBaseline;
}

Properties

antialias?: boolean

Whether to apply antialiasing to the texture. Default is false.

color?: string

The color of the text. Default is '#000000' (black).

fontFamily?: string

The font family for the text. Default is 'Arial'.

fontSize?: number

The font size for the text. Default is 16.

text: string

The text string to be rendered.

textAlign?: CanvasTextAlign

The alignment of the text. Possible values: 'left', 'right', 'center', 'start', 'end'. Default is 'left'.

textBaseline?: CanvasTextBaseline

The baseline of the text. Possible values: 'top', 'hanging', 'middle', 'alphabetic', 'ideographic', 'bottom'. Default is 'top'.