mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
Added FullScreen API support and fixed numerous StageScaleMode issues.
This commit is contained in:
+4
-6
@@ -137,8 +137,8 @@ var Phaser;
|
||||
/**
|
||||
* Phaser - FX - Camera - Mirror
|
||||
*
|
||||
* A Template FX file you can use to create your own Camera FX.
|
||||
* If you don't use any of the methods below (i.e. preUpdate, render, etc) then DELETE THEM to avoid un-necessary calls by the FXManager.
|
||||
* Creates a mirror effect for a camera.
|
||||
* Can mirror the camera image horizontally, vertically or both with an optional fill color overlay.
|
||||
*/
|
||||
(function (Camera) {
|
||||
var Mirror = (function () {
|
||||
@@ -159,7 +159,7 @@ var Phaser;
|
||||
* It is rendered to the Stage at Mirror.x/y (note the use of Stage coordinates, not World coordinates)
|
||||
*/
|
||||
function (x, y, region, fillColor) {
|
||||
if (typeof fillColor === "undefined") { fillColor = 'rgba(0,0,100,0.5)'; }
|
||||
if (typeof fillColor === "undefined") { fillColor = 'rgba(0, 0, 100, 0.5)'; }
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this._mirrorX = region.x;
|
||||
@@ -199,7 +199,6 @@ var Phaser;
|
||||
if(this._mirrorColor) {
|
||||
this._context.fillRect(0, 0, this._mirrorWidth, this._mirrorHeight);
|
||||
}
|
||||
//this._game.stage.context.save();
|
||||
if(this.flipX && this.flipY) {
|
||||
this._game.stage.context.transform(-1, 0, 0, -1, this._mirrorWidth, this._mirrorHeight);
|
||||
this._game.stage.context.drawImage(this._canvas, -this.x, -this.y);
|
||||
@@ -210,8 +209,7 @@ var Phaser;
|
||||
this._game.stage.context.transform(1, 0, 0, -1, 0, this._mirrorHeight);
|
||||
this._game.stage.context.drawImage(this._canvas, this.x, -this.y);
|
||||
}
|
||||
//this._game.stage.context.restore();
|
||||
};
|
||||
};
|
||||
return Mirror;
|
||||
})();
|
||||
Camera.Mirror = Mirror;
|
||||
|
||||
Reference in New Issue
Block a user