From d6d988ff7020cb04cf8e6b271dace10104583e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 16 Dec 2015 16:05:24 +0100 Subject: HeadedPawn: draw overlays over the head --- core/src/ch/asynk/rustanddust/engine/HeadedPawn.java | 12 ++++++++---- core/src/ch/asynk/rustanddust/engine/Pawn.java | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java index c26610f..f60e38e 100644 --- a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java +++ b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java @@ -79,16 +79,20 @@ public abstract class HeadedPawn extends Pawn @Override public void draw(Batch batch) { - super.draw(batch); + sprite.draw(batch); head.draw(batch); + overlays.draw(batch); } @Override public void drawDebug(ShapeRenderer debugShapes) { - super.drawDebug(debugShapes); - float w = head.getWidth(); - float h = head.getHeight(); + float w = sprite.getWidth(); + float h = sprite.getHeight(); + debugShapes.rect(sprite.getX(), sprite.getY(), (w / 2f), (h / 2f), w, h, sprite.getScaleX(), sprite.getScaleY(), sprite.getRotation()); + w = head.getWidth(); + h = head.getHeight(); debugShapes.rect(head.getX(), head.getY(), (w / 2f), (h / 2f), w, h, head.getScaleX(), head.getScaleY(), head.getRotation()); + overlays.drawDebug(debugShapes); } } diff --git a/core/src/ch/asynk/rustanddust/engine/Pawn.java b/core/src/ch/asynk/rustanddust/engine/Pawn.java index fc20611..43de4f4 100644 --- a/core/src/ch/asynk/rustanddust/engine/Pawn.java +++ b/core/src/ch/asynk/rustanddust/engine/Pawn.java @@ -37,8 +37,8 @@ public abstract class Pawn implements Moveable, Disposable private Tile prevTile; protected Faction faction; protected String descr; - private Sprite sprite; - private StackedImages overlays; + protected Sprite sprite; + protected StackedImages overlays; protected Attack attack; protected Move move; -- cgit v1.1-2-g2b99