Class: Plugin

Phaser. Plugin

Phaser - Plugin

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:

Members

active

Properties:
Name Type Description
active boolean

A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped.

Default Value:
  • false
Source:

game

Properties:
Name Type Description
game Phaser.Game

A reference to the currently running game.

Source:

hasPostRender

Properties:
Name Type Description
hasPostRender boolean

A flag to indicate if this plugin has a postRender method.

Default Value:
  • false
Source:

hasPostUpdate

Properties:
Name Type Description
hasPostUpdate boolean

A flag to indicate if this plugin has a postUpdate method.

Default Value:
  • false
Source:

hasPreUpdate

Properties:
Name Type Description
hasPreUpdate boolean

A flag to indicate if this plugin has a preUpdate method.

Default Value:
  • false
Source:

hasRender

Properties:
Name Type Description
hasRender boolean

A flag to indicate if this plugin has a render method.

Default Value:
  • false
Source:

hasUpdate

Properties:
Name Type Description
hasUpdate boolean

A flag to indicate if this plugin has an update method.

Default Value:
  • false
Source:

parent

Properties:
Name Type Description
parent Any

The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null.

Source:

visible

Properties:
Name Type Description
visible boolean

A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped.

Default Value:
  • false
Source:

Methods

destroy()

Clear down this Plugin and null out references

Source:

postRender()

Post-render is called after the Game Renderer and State.render have run. It is only called if visible is set to true.

Source:

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.

Source:

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.

Source:

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.

Source:
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Fri Mar 28 2014 01:41:36 GMT-0000 (GMT) using the DocStrap template.