Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • IDrawUtils

Implemented by

Index

Methods

border

  • border(x: number, y: number, width: number, height: number, color: string, borderWidth: number): void
  • Draws border (always transparent rectangle, just 4 lines)

    Parameters

    • x: number
    • y: number
    • width: number
    • height: number
    • color: string
    • borderWidth: number

    Returns void

line

  • line(x1: number, y1: number, x2: number, y2: number, color?: string, width?: number): void
  • Draws a line on canvas

    Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • Optional color: string
    • Optional width: number

    Returns void

roundRect

  • roundRect(x: number, y: number, width: number, height: number, radius?: number, fillStyle?: string, strokeStyle?: string, strokeWidth?: number): void
  • Draw (rounded) rectangle, if you don't want rounded you can set radius to 0

    Parameters

    • x: number
    • y: number
    • width: number
    • height: number
    • Optional radius: number
    • Optional fillStyle: string
    • Optional strokeStyle: string
    • Optional strokeWidth: number

    Returns void

text

  • text(x: number, y: number, text: string, color?: string, xAlign?: string, yAlign?: string, size?: number, style?: string, font?: string): TextMetrics
  • Draw text on canvas

    Parameters

    • x: number
    • y: number
    • text: string
    • Optional color: string
    • Optional xAlign: string
    • Optional yAlign: string
    • Optional size: number
    • Optional style: string
    • Optional font: string

    Returns TextMetrics

textMaxWidth

  • textMaxWidth(x: number, y: number, text: string, maxWidth: number, color?: string, xAlign?: string, yAlign?: string, size?: number, style?: string, font?: string): void
  • Draws a text if maximum width is not more then maxWidtx

    Parameters

    • x: number
    • y: number
    • text: string
    • maxWidth: number
    • Optional color: string
    • Optional xAlign: string
    • Optional yAlign: string
    • Optional size: number
    • Optional style: string
    • Optional font: string

    Returns void

Generated using TypeDoc