You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -330,6 +330,8 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
330
330
* Updated the pointer check code in the Device class, to get rid of the message `Navigator.pointerEnabled is a non-standard API added for experiments only. It will be removed in near future.` in Chrome.
331
331
* The P2 Physics library has been updated to 0.7.1. This is still quite out of date, but as soon as they release their latest build (hopefully soon) we'll update to that.
332
332
* Math.between has been strengthened and the docs improved (thanks @JTronLabs#2760)
333
+
* Camera.fade has a new argument `alpha` to control the alpha level of the effect (thanks @rgk#2493)
334
+
* Camera.flash has a new argument `alpha` to control the alpha level of the effect (thanks @rgk#2493)
Copy file name to clipboardExpand all lines: src/core/Camera.js
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -410,13 +410,15 @@ Phaser.Camera.prototype = {
410
410
* @param {numer} [color=0xffffff] - The color of the flash effect. I.e. 0xffffff for white, 0xff0000 for red, etc.
411
411
* @param {number} [duration=500] - The duration of the flash effect in milliseconds.
412
412
* @param {boolean} [force=false] - If a camera flash or fade effect is already running and force is true it will replace the previous effect, resetting the duration.
413
+
* @param {numer} [alpha=1] - The alpha value of the color applied to the flash effect.
413
414
* @return {boolean} True if the effect was started, otherwise false.
414
415
*/
415
-
flash: function(color,duration,force){
416
+
flash: function(color,duration,force,alpha){
416
417
417
418
if(color===undefined){color=0xffffff;}
418
419
if(duration===undefined){duration=500;}
419
420
if(force===undefined){force=false;}
421
+
if(alpha===undefined){alpha=1;}
420
422
421
423
if(!this.fx||(!force&&this._fxDuration>0))
422
424
{
@@ -425,7 +427,7 @@ Phaser.Camera.prototype = {
425
427
426
428
this.fx.clear();
427
429
428
-
this.fx.beginFill(color);
430
+
this.fx.beginFill(color,alpha);
429
431
this.fx.drawRect(0,0,this.width,this.height);
430
432
this.fx.endFill();
431
433
@@ -455,13 +457,15 @@ Phaser.Camera.prototype = {
455
457
* @param {numer} [color=0x000000] - The color the game will fade to. I.e. 0x000000 for black, 0xff0000 for red, etc.
456
458
* @param {number} [duration=500] - The duration of the fade in milliseconds.
457
459
* @param {boolean} [force=false] - If a camera flash or fade effect is already running and force is true it will replace the previous effect, resetting the duration.
460
+
* @param {numer} [alpha=1] - The alpha value of the color applied to the fade effect.
458
461
* @return {boolean} True if the effect was started, otherwise false.
0 commit comments