phaser/v3/src/gameobjects/components/Flip.js

51 lines
680 B
JavaScript
Raw Normal View History

var Flip = {
flipX: false,
flipY: false,
toggleFlipX: function ()
{
this.flipX = !this.flipX;
return this;
},
toggleFlipY: function (value)
{
this.flipY = !this.flipY;
return this;
},
2017-03-27 22:53:22 +00:00
setFlipX: function (value)
{
this.flipX = value;
return this;
},
setFlipY: function (value)
{
this.flipX = value;
return this;
},
setFlip: function (x, y)
{
this.flipX = x;
this.flipY = y;
return this;
},
resetFlip: function ()
{
this.flipX = false;
this.flipY = false;
}
};
2017-03-27 22:53:22 +00:00
module.exports = Flip;