瀏覽代碼

added flipX/flipY

ncannasse 11 年之前
父節點
當前提交
5754457cf1
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      h2d/Tile.hx

+ 10 - 0
h2d/Tile.hx

@@ -97,6 +97,16 @@ class Tile {
 		y = Std.int(v * tex.height);
 	}
 
+	public function flipX() {
+		var tmp = u; u = u2; u2 = tmp;
+		dx = -dx - width;
+	}
+
+	public function flipY() {
+		var tmp = v; v = v2; v2 = tmp;
+		dy = -dy - height;
+	}
+
 	public function dispose() {
 		if( innerTex != null ) innerTex.dispose();
 		innerTex = null;