From 742754ebb1ca82bde1e3ea6ef7abad10b24e7597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 31 Mar 2016 14:32:21 +0200 Subject: Moveable: add setScale(float) --- core/src/ch/asynk/rustanddust/engine/Pawn.java | 7 +++++++ core/src/ch/asynk/rustanddust/engine/gfx/Moveable.java | 1 + core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/core/src/ch/asynk/rustanddust/engine/Pawn.java b/core/src/ch/asynk/rustanddust/engine/Pawn.java index 5a40c9f..56e73f4 100644 --- a/core/src/ch/asynk/rustanddust/engine/Pawn.java +++ b/core/src/ch/asynk/rustanddust/engine/Pawn.java @@ -238,6 +238,13 @@ public abstract class Pawn implements Moveable, Disposable } @Override + public void setScale(float scale) + { + sprite.setScale(scale); + overlays.setScale(scale); + } + + @Override public void setAlpha(float alpha) { sprite.setAlpha(alpha); diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/Moveable.java b/core/src/ch/asynk/rustanddust/engine/gfx/Moveable.java index 55c0297..438b67b 100644 --- a/core/src/ch/asynk/rustanddust/engine/gfx/Moveable.java +++ b/core/src/ch/asynk/rustanddust/engine/gfx/Moveable.java @@ -4,6 +4,7 @@ import ch.asynk.rustanddust.engine.Faction; public interface Moveable extends Drawable { + public void setScale(float x); public void setAlpha(float alpha); public boolean canAim(); public float getX(); diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java b/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java index 6d4fd1f..325eb56 100644 --- a/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java +++ b/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java @@ -47,6 +47,12 @@ public class StackedImages implements Drawable, Disposable return false; } + public void setScale(float scale) + { + for (int i = 0, n = sprites.size; i < n; i++) + sprites.get(i).setScale(scale); + } + public void setAlpha(float alpha) { for (int i = 0, n = sprites.size; i < n; i++) -- cgit v1.1-2-g2b99