Class: ViewSystem

ViewSystem

The view system manages the main canvas that is attached to the DOM. This main role is to deal with how the holding the view reference and dealing with how it is resized.

new ViewSystem ()

Implements

Members

autoDensity boolean

Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.

canvas ICanvas

The canvas element that everything is drawn to.

Methods

destroy (options) void

Destroys this System and optionally removes the canvas from the dom.

Name Type Default Description
options options | false false

The options for destroying the view, or "false".

options.removeView

Whether to remove the view element from the DOM. Defaults to false.

init (options) void

initiates the view system

Name Type Description
options ViewSystemOptions

the options for the view

resize (desiredScreenWidth, desiredScreenHeight, resolution) void

Resizes the screen and canvas to the specified dimensions.

Name Type Description
desiredScreenWidth number

The new width of the screen.

desiredScreenHeight number

The new height of the screen.

resolution number