summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-05 23:06:42 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-05 23:06:42 +0100
commit264371369cd122915edda5216213a7be77b1779a (patch)
tree46ff3015332777157b1dbcfc93629bee71199726
parentba5426e4b64ebf01182b1a0c72da31d0c4c58210 (diff)
downloadRustAndDust-264371369cd122915edda5216213a7be77b1779a.zip
RustAndDust-264371369cd122915edda5216213a7be77b1779a.tar.gz
Pawn,HeadedPawn,StackedImages: add setAlpha(float)
-rw-r--r--core/src/ch/asynk/tankontank/engine/HeadedPawn.java7
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java6
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java6
3 files changed, 19 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
index fb362bc..d237e88 100644
--- a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
+++ b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
@@ -30,6 +30,13 @@ public abstract class HeadedPawn extends Pawn
}
@Override
+ public void setAlpha(float alpha)
+ {
+ super.setAlpha(alpha);
+ head.setAlpha(alpha);
+ }
+
+ @Override
public float getRotation()
{
return orientation.r();
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index 11329b6..66c7122 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -368,6 +368,12 @@ public abstract class Pawn implements Moveable, Disposable
return seq;
}
+ public void setAlpha(float alpha)
+ {
+ image.setAlpha(alpha);
+ overlays.setAlpha(alpha);
+ }
+
@Override
public void draw(Batch batch)
{
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
index a659c68..cb91016 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
@@ -47,6 +47,12 @@ public class StackedImages implements Drawable, Disposable
return false;
}
+ public void setAlpha(float alpha)
+ {
+ for (int i = 0, n = sprites.size; i < n; i++)
+ sprites.get(i).setAlpha(alpha);
+ }
+
public void rotate(int i, float r)
{
sprites.get(i).setRotation(r);