diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-02 10:23:24 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-02 10:23:24 +0100 |
commit | 673d4c8a9face645fe30c44f81451ca32f447b61 (patch) | |
tree | beabb8c351c71c9e4987f97d20252e22765556e5 /core | |
parent | 6ce89509ff6ed0d456020ab00efa8c8fb07fb729 (diff) | |
download | RustAndDust-673d4c8a9face645fe30c44f81451ca32f447b61.zip RustAndDust-673d4c8a9face645fe30c44f81451ca32f447b61.tar.gz |
Board: use Sprite instead of Image for board texture
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 40c1736..6aa6ea7 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -11,11 +11,11 @@ import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Matrix4; -import ch.asynk.tankontank.engine.gfx.Image; import ch.asynk.tankontank.engine.gfx.Animation; import ch.asynk.tankontank.engine.gfx.animations.AnimationSequence; import ch.asynk.tankontank.engine.gfx.animations.RunnableAnimation; @@ -49,7 +49,7 @@ public abstract class Board implements Disposable, Animation private Config cfg; private Tile[] tiles; private SearchBoard searchBoard; - private Image image; + private Sprite board; private Orientation sides[]; private boolean transform; @@ -75,7 +75,7 @@ public abstract class Board implements Disposable, Animation public Board(TileBuilder tileBuilder, Config cfg, Texture boardTexture, SelectedTile selectedTile) { - image = new Image(boardTexture); + board = new Sprite(boardTexture); this.cfg = cfg; // add a frame of OFFMAP Tiles this.cols = (cfg.cols + 2); @@ -114,7 +114,6 @@ public abstract class Board implements Disposable, Animation @Override public void dispose() { - image.dispose(); for (int i = 0; i < (this.cols * this.rows); i++) tiles[i].dispose(); tilesToDraw.clear(); @@ -130,17 +129,17 @@ public abstract class Board implements Disposable, Animation public float getWidth() { - return image.getWidth(); + return board.getWidth(); } public float getHeight() { - return image.getHeight(); + return board.getHeight(); } public void setPosition(float x, float y) { - image.setPosition(x, y); + board.setPosition(x, y); if ((x != 0.0f) || (y != 0.0f)) { transform = true; prevTransform = new Matrix4(); @@ -251,7 +250,7 @@ public abstract class Board implements Disposable, Animation public void draw(Batch batch) { - image.draw(batch); + board.draw(batch); if (transform) { prevTransform.set(batch.getTransformMatrix()); |