summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-31 14:32:21 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-31 14:32:21 +0200
commit742754ebb1ca82bde1e3ea6ef7abad10b24e7597 (patch)
tree1fd443080f98cdcbac27bdf40daaf9bebc43e99c /core
parent07d59e9ef48774b91b017506fdfb7de13c2327dd (diff)
downloadRustAndDust-742754ebb1ca82bde1e3ea6ef7abad10b24e7597.zip
RustAndDust-742754ebb1ca82bde1e3ea6ef7abad10b24e7597.tar.gz
Moveable: add setScale(float)
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Pawn.java7
-rw-r--r--core/src/ch/asynk/rustanddust/engine/gfx/Moveable.java1
-rw-r--r--core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java6
3 files changed, 14 insertions, 0 deletions
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++)