Interface DrawOptions

Passed to the draw function of a GameObject

DrawOptions

Example

 const options: DrawOptions = {
canvas: document.getElementById("canvas") as HTMLCanvasElement,
ctx: document.getElementById("canvas").getContext("2d"),
camera: [0, 0]
}
interface DrawOptions {
    camera: Vec2;
    canvas?: HTMLCanvasElement;
    ctx: CanvasRenderingContext2D;
}

Properties

Properties

camera: Vec2

Position of the camera in the scene

canvas?: HTMLCanvasElement

Used for positional calculations.

ctx: CanvasRenderingContext2D

Canvas rendering context that the object draws with

Generated using TypeDoc