summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/Image.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Image.java b/core/src/ch/asynk/tankontank/engine/gfx/Image.java
index 282e03b..5797655 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/Image.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/Image.java
@@ -32,6 +32,11 @@ public class Image extends Sprite implements Drawable, Disposable
if (texture != null) texture.dispose();
}
+ public boolean contains(float x, float y)
+ {
+ return ((x >= getX()) && (y >= getY()) && (x <= (getX() + getWidth())) && (y <= (getY() + getHeight())));
+ }
+
public void setPosition(float x, float y, float r)
{
setPosition(x, y);