From fd7ea8aebcf7b3bbc2cb441a971df8cc2fe37d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 20 Sep 2014 22:51:45 +0200 Subject: fix SpriteNode : extends Sprite implements Node --- core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java b/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java index f714203..dd1c648 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java @@ -7,30 +7,28 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public abstract class SpriteNode extends Sprite implements Node { + private Texture texture; + public SpriteNode(Texture texture) { super(texture); + this.texture = texture; } public SpriteNode(TextureRegion region) { super(region); + this.texture = null; } @Override public void dispose() { - // FIXME : what to do with dispose in SpriteNode - } - - @Override - public void moveBy(float dx, float dy) - { - translate(dx, dy); + if (texture != null) texture.dispose(); } @Override - public void setCoords(float x, float y, float r) + public void setPosition(float x, float y, float r) { setPosition(x, y); setRotation(r); -- cgit v1.1-2-g2b99