Plugin
Class: Phaser.Plugin
Constructor
new Plugin(game, parent)
This is a base Plugin template to use for any Phaser plugin development.
Parameters
Name | Type | Description |
---|---|---|
game | Phaser.Game | A reference to the currently running game. |
parent | any | The object that owns this plugin, usually Phaser.PluginManager. |
- Source code: core/Plugin.js (Line 15)
Classes
Public Properties
- Source code: core/Plugin.js (Line 33)
- Source code: core/Plugin.js (Line 22)
- Source code: core/Plugin.js (Line 69)
- Source code: core/Plugin.js (Line 57)
- Source code: core/Plugin.js (Line 45)
- Source code: core/Plugin.js (Line 63)
- Source code: core/Plugin.js (Line 51)
- Source code: core/Plugin.js (Line 27)
- Source code: core/Plugin.js (Line 39)
active : boolean
A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped.
game : Phaser.Game
A reference to the currently running game.
hasPostRender : boolean
A flag to indicate if this plugin has a postRender method.
hasPostUpdate : boolean
A flag to indicate if this plugin has a postUpdate method.
hasPreUpdate : boolean
A flag to indicate if this plugin has a preUpdate method.
hasRender : boolean
A flag to indicate if this plugin has a render method.
hasUpdate : boolean
A flag to indicate if this plugin has an update method.
parent :any
The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null.
visible : boolean
A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped.
Public Methods
- Source code: core/Plugin.js (Line 107)
- Source code: core/Plugin.js (Line 99)
- Source code: core/Plugin.js (Line 75)
- Source code: core/Plugin.js (Line 91)
- Source code: core/Plugin.js (Line 83)
destroy()
Clear down this Plugin and null out references
postRender()
Post-render is called after the Game Renderer and State.render have run.
It is only called if visible is set to true.
preUpdate()
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()
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()
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