Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Screen

This class represents the game's screen (canvas).
It makes it easy to access the width, height and offsets properties of the game's screen from anywhere in your game.

Hierarchy

  • Screen

Index

Accessors

Static height

  • get height(): number
  • The height of the game's canvas.

    Returns number

Static offsetHeight

  • get offsetHeight(): number
  • The offset height of the game's canvas.

    Returns number

Static offsetWidth

  • get offsetWidth(): number
  • The offset width of the game's canvas.

    Returns number

Static offsetX

  • get offsetX(): number
  • The offset left of the game canvas.

    Returns number

Static offsetY

  • get offsetY(): number
  • The offset top of the game canvas.

    Returns number

Static width

  • get width(): number
  • The width of the game's canvas.

    Returns number

Methods

Static _init

  • _init(canvas: HTMLCanvasElement): void
  • Used internally to initialise the Screen class.

    Parameters

    • canvas: HTMLCanvasElement

      The game's canvas.

    Returns void

Generated using TypeDoc