Added helper methods for flip, visible and alpha

This commit is contained in:
Richard Davey 2018-01-20 16:21:42 +00:00
parent b951809791
commit d220634fb6

View file

@ -20,6 +20,20 @@ var Bob = new Class({
this.flipY = false;
},
setFrame: function (frame)
{
if (frame === undefined)
{
frame = this.parent.frame;
}
else
{
frame = this.parent.texture.get(frame);
}
return this;
},
resetFlip: function ()
{
this.flipX = false;
@ -33,6 +47,42 @@ var Bob = new Class({
this.frame = frame;
},
setFlipX: function (value)
{
this.flipX = value;
return this;
},
setFlipY: function (value)
{
this.flipY = value;
return this;
},
setFlip: function (x, y)
{
this.flipX = x;
this.flipY = y;
return this;
},
setVisible: function (value)
{
this.visible = value;
return this;
},
setAlpha: function (value)
{
this.alpha = value;
return this;
},
destroy: function ()
{
this.parent.dirty = true;