浏览代码

added center()

ncannasse 12 年之前
父节点
当前提交
11d51c484a
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      h2d/Tile.hx

+ 4 - 0
h2d/Tile.hx

@@ -58,6 +58,10 @@ class Tile {
 		return new Tile(innerTex, this.x + x, this.y + y, w, h, dx, dy);
 	}
 	
+	public function center(dx, dy) {
+		return sub(0, 0, width, height, -dx, -dy);
+	}
+	
 	public function setPos(x, y) {
 		this.x = x;
 		this.y = y;