Phaser.Component. Reset

new Reset()

The Reset component allows a Game Object to be reset and repositioned to a new location.

Source - gameobjects/components/Reset.js, line 12


reset(x, y, health) → {PIXI.DisplayObject}

Resets the Game Object.

This moves the Game Object to the given x/y world coordinates and sets fresh, exists, visible and renderable to true.

If this Game Object has the LifeSpan component it will also set alive to true and health to the given value.

If this Game Object has a Physics Body it will reset the Body.

Name Type Argument Default Description
x number

The x coordinate (in world space) to position the Game Object at.

y number

The y coordinate (in world space) to position the Game Object at.

health number <optional>

The health to give the Game Object if it has the Health component.

PIXI.DisplayObject -

This instance.

Source - gameobjects/components/Reset.js, line 30
Phaser Copyright © 2012-2016 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.3 on Mon Jul 11 2016 10:10:46 GMT+0100 (GMT Daylight Time) using the DocStrap template.