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

defaultOptions ViewSystemOptions static

The default options for the view system.

Properties:
Name Type Default Description
antialias boolean false

WebGLOptions.antialias

autoDensity boolean false

WebGLOptions.autoDensity

height number 600

WebGLOptions.height

width number 800

WebGLOptions.width

antialias boolean

Whether to enable anti-aliasing. This may affect performance.

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.

renderTarget RenderTarget

The render target that the view is drawn to.

resolution number

The resolution / device pixel ratio of the renderer.

screen Rectangle

Measurements of the screen. (0, 0, screenWidth, screenHeight).

Its safe to use as filterArea or hitArea for the whole stage.

texture Texture

The texture that is used to draw the canvas to the screen.

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