Camera#flash()

flash(color, duration, force) → {boolean}

This creates a camera flash effect. It works by filling the game with the solid fill
color specified, and then fading it away to alpha 0 over the duration given.

You can use this for things such as hit feedback effects.

When the effect ends the signal Camera.onFlashComplete is dispatched.

Parameters
Name Type Argument Default Description
color numer <optional>
0xffffff

The color of the flash effect. I.e. 0xffffff for white, 0xff0000 for red, etc.

duration number <optional>
500

The duration of the flash effect in milliseconds.

force boolean <optional>
false

If a camera flash or fade effect is already running and force is true it will replace the previous effect, resetting the duration.

Returns
boolean -

True if the effect was started, otherwise false.

Source code: core/Camera.js (Line 401)
doc_phaser
2017-02-14 10:40:46
Comments
Leave a Comment

Please login to continue.