소스 검색

getCenter method.

Gilian Joosen 10 년 전
부모
커밋
a0c16c1abe
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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;