The Plugin Manager is responsible for the loading, running and unloading of Phaser Plugins.
Name | Type | Description |
---|---|---|
game | Phaser.Game | A reference to the currently running game. |
A reference to the currently running game.
An array of all the plugins being managed by this PluginManager.
Add a new Plugin into the PluginManager.
The Plugin must have 2 properties: game and parent. Plugin.game is set to the game reference the PluginManager uses, and parent is set to the PluginManager.
Name | Type | Argument | Description |
---|---|---|---|
plugin | object | Phaser.Plugin | The Plugin to add into the PluginManager. This can be a function or an existing object. | |
parameter | * | <repeatable> | Additional arguments that will be passed to the Plugin.init method. |
The Plugin that was added to the manager.
Clear down this PluginManager, calls destroy on every plugin and nulls out references.
Post-render is called after the Game Renderer and State.render have run.
It only calls plugins who have visible=true.
PostUpdate is the last thing to be called before the world render.
In particular, it is called after the world postUpdate, which means the camera has been adjusted.
It only calls plugins who have active=true.
Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
It only calls plugins who have active=true.
Remove a Plugin from the PluginManager. It calls Plugin.destroy on the plugin before removing it from the manager.
Name | Type | Argument | Default | Description |
---|---|---|---|---|
plugin | Phaser.Plugin | The plugin to be removed. | ||
destroy | boolean | <optional> | true | Call destroy on the plugin that is removed? |
Remove all Plugins from the PluginManager. It calls Plugin.destroy on every plugin before removing it from the manager.
Render is called right after the Game Renderer completes, but before the State.render.
It only calls plugins who have visible=true.
Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
It only calls plugins who have active=true.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.PluginManager.html