summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2019-01-15 17:36:05 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2019-01-15 17:36:05 +0100
commita676cc05908ac0a5c6471e76c0843e15314972d6 (patch)
tree5b02110641cd3cf85b50480f3cb63820ae254b64 /core/src/ch/asynk/gdx/boardgame/FramedSprite.java
parent021abd4a0228c90d035e602feb32036fc3b4c111 (diff)
downloadgdx-boardgame-a676cc05908ac0a5c6471e76c0843e15314972d6.zip
gdx-boardgame-a676cc05908ac0a5c6471e76c0843e15314972d6.tar.gz
FramedSprite : fix shared TextureRegion between instances
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/FramedSprite.java')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/FramedSprite.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/FramedSprite.java b/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
index 2f41afe..d6c5fc7 100644
--- a/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
+++ b/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
@@ -46,10 +46,11 @@ public class FramedSprite implements Drawable, Positionable
public FramedSprite(FramedSprite other)
{
- this.frames = other.frames;
- this.frame = other.frame;
+ Texture t = other.frame.getTexture();
this.rows = other.rows;
this.cols = other.cols;
+ this.frames = TextureRegion.split(t, (t.getWidth() / cols), (t.getHeight() / rows));
+ this.frame = frames[0][0];
this.x = other.x;
this.y = other.y;
this.a = other.a;