Explorar o código

add ix, iy, iwidth, iheight accessors for backwards compat

trethaller %!s(int64=6) %!d(string=hai) anos
pai
achega
13243a3cfe
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      h2d/Tile.hx

+ 12 - 0
h2d/Tile.hx

@@ -17,6 +17,18 @@ class Tile {
 	public var width(default,null) : Float;
 	public var height(default,null) : Float;
 
+	public var ix(get,never) : Int;
+	function get_ix() return Std.int(x);
+
+	public var iy(get,never) : Int;
+	function get_iy() return Std.int(y);
+
+	public var iwidth(get,never) : Int;
+	function get_iwidth() return Std.int(width);
+
+	public var iheight(get,never) : Int;
+	function get_iheight() return Std.int(height);
+
 	function new(tex : h3d.mat.Texture, x : Float, y : Float, w : Float, h : Float, dx : Float=0, dy : Float=0) {
 		this.innerTex = tex;
 		this.x = x;