Browse Source

added flipX/flipY

ncannasse 11 years ago
parent
commit
5754457cf1
1 changed files with 10 additions and 0 deletions
  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;