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
-
- Default Value:
- null
- Source:
Properties:
Name Type Description add
Phaser.GameObjectFactory Reference to the GameObjectFactory.
-
cache
-
- Default Value:
- null
- Source:
Properties:
Name Type Description cache
Phaser.Cache Reference to the assets cache.
-
camera
-
- Default Value:
- null
- Source:
Properties:
Name Type Description camera
Phaser.Physics.PhysicsManager A handy reference to world.camera.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game A reference to the currently running Game.
-
input
-
- Default Value:
- null
- Source:
Properties:
Name Type Description input
Phaser.Input Reference to the input manager
-
load
-
- Default Value:
- null
- Source:
Properties:
Name Type Description load
Phaser.Loader Reference to the assets loader.
-
math
-
- Default Value:
- null
- Source:
Properties:
Name Type Description math
Phaser.GameMath Reference to the math helper.
-
particles
-
- Default Value:
- null
- Source:
Properties:
Name Type Description add
Description Description.
-
physics
-
- Default Value:
- null
- Source:
Properties:
Name Type Description physics
Phaser.Physics.PhysicsManager Reference to the physics manager.
-
sound
-
- Default Value:
- null
- Source:
Properties:
Name Type Description sound
Phaser.SoundManager Reference to the sound manager.
-
stage
-
- Default Value:
- null
- Source:
Properties:
Name Type Description stage
Phaser.Stage Reference to the stage.
-
time
-
- Default Value:
- null
- Source:
Properties:
Name Type Description time
Phaser.TimeManager Reference to game clock.
-
tweens
-
- Default Value:
- null
- Source:
Properties:
Name Type Description tweens
Phaser.TweenManager Reference to the tween manager.
-
world
-
- Default Value:
- null
- Source:
Properties:
Name Type Description world
Phaser.World Reference to the world.
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: