Class: State

Phaser. State

Phaser.State

new State()

This is a base State class which can be extended if you are creating your own game. It provides quick access to common functions such as the camera, cache, input, match, sound and more.

Source:

Members

add

Properties:
Name Type Description
add Phaser.GameObjectFactory

Reference to the GameObjectFactory.

Default Value:
  • null
Source:

cache

Properties:
Name Type Description
cache Phaser.Cache

Reference to the assets cache.

Default Value:
  • null
Source:

camera

Properties:
Name Type Description
camera Phaser.Camera

A handy reference to world.camera.

Default Value:
  • null
Source:

game

Properties:
Name Type Description
game Phaser.Game

A reference to the currently running Game.

Source:

input

Properties:
Name Type Description
input Phaser.Input

Reference to the input manager

Default Value:
  • null
Source:

load

Properties:
Name Type Description
load Phaser.Loader

Reference to the assets loader.

Default Value:
  • null
Source:

math

Properties:
Name Type Description
math Phaser.Math

Reference to the math helper.

Default Value:
  • null
Source:

particles

Properties:
Name Type Description
particles Phaser.Particles

The Particle Manager for the game. It is called during the game update loop and in turn updates any Emitters attached to it.

Default Value:
  • null
Source:

physics

Properties:
Name Type Description
physics Phaser.Physics.PhysicsManager

Reference to the physics manager.

Default Value:
  • null
Source:

sound

Properties:
Name Type Description
sound Phaser.SoundManager

Reference to the sound manager.

Default Value:
  • null
Source:

stage

Properties:
Name Type Description
stage Phaser.Stage

Reference to the stage.

Default Value:
  • null
Source:

time

Properties:
Name Type Description
time Phaser.TimeManager

Reference to game clock.

Default Value:
  • null
Source:

tweens

Properties:
Name Type Description
tweens Phaser.TweenManager

Reference to the tween manager.

Default Value:
  • null
Source:

world

Properties:
Name Type Description
world Phaser.World

Reference to the world.

Default Value:
  • null
Source:

Methods

create()

This method is called after the game engine successfully switches states. Feel free to add any setup code here (do not load anything here, override preload() instead).

Source:

destroy()

This method will be called when the state is destroyed.

Source:

loadRender()

Put render operations here.

Source:

loadUpdate()

Put update logic here.

Source:

paused()

This method will be called when game paused.

Source:

preload()

Override this method to add some load operations. If you need to use the loader, you may need to use them here.

Source:

render()

Put render operations here.

Source:

update()

Put update logic here.

Source:
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template.