mirror of
https://github.com/photonstorm/phaser
synced 2025-03-04 23:37:19 +00:00
Added helper methods for flip, visible and alpha
This commit is contained in:
parent
b951809791
commit
d220634fb6
1 changed files with 50 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue