Kaynağa Gözat

getCenter method.

Gilian Joosen 10 yıl önce
ebeveyn
işleme
a0c16c1abe
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  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;
     }
 
+    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
     public double getX() {
         return x;