Explorar o código

added center()

ncannasse %!s(int64=12) %!d(string=hai) anos
pai
achega
11d51c484a
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;