Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ObnizUtil

Hierarchy

  • ObnizUtil

Index

Constructors

constructor

  • Parameters

    • obniz: any

    Returns ObnizUtil

Properties

createCanvas

createCanvas: any

height

height: any

obniz

obniz: any

width

width: any

Methods

createCanvasContext

  • createCanvasContext(width: number, height: number): any
  • This creates a Canvas context. It will add a canvas dom to body(in html).

    // Example
    const ctx = obniz.util.createCanvasContext(128, 64);
    ctx.font = "9px sans-serif";
    ctx.fillText('Hello', 0, 7);

    Parameters

    • width: number
    • height: number

    Returns any

Static dataArray2string

  • dataArray2string(data: number[]): string | null
  • convert from data array to string

    Parameters

    • data: number[]

    Returns string | null

Static string2dataArray

  • string2dataArray(str: string): any[]
  • convert from string to data array

    Parameters

    • str: string

    Returns any[]

Generated using TypeDoc