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 - core/Plugin.js, line 15

Classes

AStar
ColorHarmony
CSS3Filters
Juicy
KineticScrolling
PathManager
SamplePlugin
TilemapWalker
VirtualJoystick
Webcam

Members

active :boolean

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

Source - core/Plugin.js, line 33

game :Phaser.Game

A reference to the currently running game.

Source - core/Plugin.js, line 22

hasPostRender :boolean

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

Source - core/Plugin.js, line 69

hasPostUpdate :boolean

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

Source - core/Plugin.js, line 57

hasPreUpdate :boolean

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

Source - core/Plugin.js, line 45

hasRender :boolean

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

Source - core/Plugin.js, line 63

hasUpdate :boolean

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

Source - core/Plugin.js, line 51

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 - core/Plugin.js, line 27

visible :boolean

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

Source - core/Plugin.js, line 39

Methods

<static> AStar-isWalkable(x, y) → {boolean}

Tells if a tile is walkable from its tilemap coordinates

Parameters:
Name Type Description
x number

The x coordiante of the tile in tilemap's coordinate.

y number

The y coordinate of the tile in tilemap's coordinate.

Returns:
boolean -

The distance between nodeA and nodeB

Source - out/plugins/AStar/AStar.js, line 460

<static> ScreenShake()

Plugin to make screen shake FX (makes number of short camera movements).

Usage:
in main create function:
game.plugins.screenShake = game.plugins.add(Phaser.Plugin.ScreenShake);

in function where need to call shake FX:
game.plugins.screenShake.setup({ //if need to replace default plugin settings
shakeX: true,
shakeY: false
});
this.game.plugins.screenShake.shake(10); //pass shake count value

Author:
License:
  • http://choosealicense.com/licenses/mit
Source - out/plugins/ScreenShake/ScreenShake.js, line 24

destroy()

Clear down this Plugin and null out references

Source - core/Plugin.js, line 107

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 - core/Plugin.js, line 99

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 - core/Plugin.js, line 75

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 - core/Plugin.js, line 91

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 - core/Plugin.js, line 83
Phaser Copyright © 2012-2016 Photon Storm Ltd.
Documentation generated by JSDoc 3.4.3 on Thu Apr 13 2017 12:05:12 GMT-0700 (PDT) using the DocStrap template.