Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SmoothCamera

A camera that follows its target by moving at constant speed.

Hierarchy

Index

Constructors

  • Parameters

    • can: Canvas
    • target: Vec2

      initial point to look at

    • speed: number

      speed at wich the camera moves (pixel per seconds)

    • Optional offset: Vec2

      offset from screen center

    Returns SmoothCamera

Properties

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

Accessors

  • return the rectangle currently showed through the camera.

    Returns Rect

Methods

Generated using TypeDoc