Browse Source

added flipX/flipY

ncannasse 11 năm trước cách đây
mục cha
commit
5754457cf1
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  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;