Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Camera

Camera Change the target property to move the camera around. It needs to be set on every frame.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • can: Canvas
    • target: Vec2

      initial point to look at

    • Optional offset: Vec2

      offset from screen center

    Returns Camera

Properties

can: Canvas
center: Vec2
ctx: CanvasRenderingContext2D
pos: Vec2
target: Vec2

Accessors

  • return the rectangle currently showed through the camera.

    Returns Rect

Methods

  • Start rendering through this camera

    Returns Camera

  • Stop rendering through this camera

    Returns Camera

  • update the camera

    Parameters

    • _dt: number

    Returns Camera

Generated using TypeDoc