This is a base Plugin template to use for any Phaser plugin development.
Name | Type | Description |
---|---|---|
game | Phaser.Game | A reference to the currently running game. |
parent | any | The object that owns this plugin, usually Phaser.PluginManager. |
A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped.
A reference to the currently running game.
A flag to indicate if this plugin has a postRender method.
A flag to indicate if this plugin has a postUpdate method.
A flag to indicate if this plugin has a preUpdate method.
A flag to indicate if this plugin has a render method.
A flag to indicate if this plugin has an update method.
The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null.
A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped.
Clear down this Plugin and null out references
Post-render is called after the Game Renderer and State.render have run.
It is only called if visible is set to true.
Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
It is only called if active is set to true.
Render is called right after the Game Renderer completes, but before the State.render.
It is only called if visible is set to true.
Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
It is only called if active is set to true.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.Plugin.html