Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "text"

Index

Functions

Const textBox

  • textBox(canvas: Canvas, x: number, y: number, width: number, height: number, txt: string, opts?: Partial<TextBoxOpts>): number

Const textColumn

  • textColumn(canvas: Canvas, x: number, y: number, width: number, txt: string, format?: number): number
  • Writes multiline string at position x,y and using column width, also taking the current clip rect and format into account. Applies word wrapping.

    Parameters

    • canvas: Canvas
    • x: number
    • y: number
    • width: number
    • txt: string
    • Default value format: number = canvas.format

    Returns number

Const textLine

  • textLine(canvas: Canvas, x: number, y: number, line: string, format?: number): void
  • Writes given string at position x,y, taking the current clip rect and format into account. The string MUST not include linebreaks or other control chars.

    Parameters

    • canvas: Canvas
    • x: number
    • y: number
    • line: string
    • Default value format: number = canvas.format

    Returns void

Const textLines

  • textLines(canvas: Canvas, x: number, y: number, lines: string[], format?: number): number

Const wordWrappedLines

  • wordWrappedLines(width: number, txt: string): string[]

Generated using TypeDoc