Browse Source

getCenter method.

Gilian Joosen 10 years ago
parent
commit
a0c16c1abe
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/gui/simulator/DrawEngine.java

+ 5 - 0
src/gui/simulator/DrawEngine.java

@@ -53,6 +53,11 @@ public abstract class DrawEngine {
     	return image;
     	return image;
     }
     }
 
 
+    public Point2D.Double getCenter(){
+        Point2D.Double center = new Point2D.Double(x + this.image.getWidth(null) / 2, y + this.image.getHeight(null)/2);
+        return center;
+    }
+
     //getters and setters down here
     //getters and setters down here
     public double getX() {
     public double getX() {
         return x;
         return x;