Added in setFrame method to all texture based Game Objects.

This commit is contained in:
photonstorm 2017-08-14 13:12:45 +01:00
parent 3a8c50fbe3
commit 8e19673f08

View file

@ -12,6 +12,11 @@ var Texture = {
{
this.texture = this.scene.sys.textures.get(key);
return this.setFrame(frame);
},
setFrame: function (frame)
{
this.frame = this.texture.get(frame);
if (!this.frame.cutWidth || !this.frame.cutHeight)