Class: Stage

Phaser. Stage

Phaser.Stage

new Stage(game, width, height)

The Stage controls the canvas on which everything is displayed. It handles display within the browser, focus handling, game resizing, scaling and the pause, boot and orientation screens.

Parameters:
Name Type Description
game Phaser.Game

Game reference to the currently running game.

width number

Width of the canvas element.

height number

Height of the canvas element.

Source:

Members

aspectRatio

Properties:
Name Type Description
aspectRatio number

Aspect ratio.

Source:

backgroundColor

Properties:
Name Type Description
backgroundColor number | string

Gets and sets the background color of the stage. The color can be given as a number: 0xff0000 or a hex string: '#ff0000'

Source:

canvas

Properties:
Name Type Description
canvas HTMLCanvasElement

Reference to the newly created <canvas> element.

Source:

checkOffsetInterval

Properties:
Name Type Description
checkOffsetInterval number | false

The time (in ms) between which the stage should check to see if it has moved.

Default Value:
  • 2500
Source:

game

Properties:
Name Type Description
game Phaser.Game

A reference to the currently running Game.

Source:

offset

Properties:
Name Type Description
offset Phaser.Point

Get the offset values (for input and other things).

Source:

scale

Properties:
Name Type Description
scale Phaser.StageScaleMode

The scale of the current running game.

Source:

scaleMode

Properties:
Name Type Description
scaleMode number

The current scaleMode.

Source:

Methods

update()

Runs Stage processes that need periodic updates, such as the offset checks.

Source:

visibilityChange(event)

This method is called when the document visibility is changed.

Parameters:
Name Type Description
event Event

Its type will be used to decide whether the game should be paused or not.

Source:
Phaser Copyright © 2012-2013 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Thu Nov 07 2013 06:07:40 GMT-0000 (GMT) using the DocStrap template.