diff --git a/openfl/tiled/Layer.hx b/openfl/tiled/Layer.hx index 54038e0..5860d91 100644 --- a/openfl/tiled/Layer.hx +++ b/openfl/tiled/Layer.hx @@ -91,14 +91,14 @@ class Layer { throw "TmxLayer - data compression type not supported!"; } } - tileGIDs = base64ToArray(chunk, width, compressed); + tileGIDs = base64ToArray(chunk, width, compressed); case "csv": chunk = child.firstChild().nodeValue; tileGIDs = csvToArray(chunk); default: for (tile in child) { if (Helper.isValidElement(tile)) { - var gid = Std.parseInt(tile.get("gid")); + var gid = Std.parseInt(tile.get("gid")); tileGIDs.push(gid); } } diff --git a/openfl/tiled/Tileset.hx b/openfl/tiled/Tileset.hx index 96838fc..8a54890 100644 --- a/openfl/tiled/Tileset.hx +++ b/openfl/tiled/Tileset.hx @@ -57,7 +57,8 @@ class Tileset { /** The image of this tileset */ public var image:TilesetImage; - private function new(name:String, tileWidth:Int, tileHeight:Int, spacing:Int, properties:Map, image:TilesetImage) { + private function new(name:String, tileWidth:Int, tileHeight:Int, spacing:Int, + properties:Map, image:TilesetImage) { this.name = name; this.tileWidth = tileWidth; this.tileHeight = tileHeight; @@ -134,8 +135,8 @@ class Tileset { var texturePositionY:Float = getTexturePositionByGID(gid).y; var texture:BitmapData = Helper.getBitmapData(this.image.source); - var rect:Rectangle = new Rectangle((texturePositionX * this.tileWidth) + (texturePositionX * spacing), - (texturePositionY * this.tileHeight) + (texturePositionY * spacing), this.tileWidth, this.tileHeight); + var rect:Rectangle = new Rectangle((texturePositionX * this.tileWidth) + (texturePositionX + spacing), + (texturePositionY * this.tileHeight) + (texturePositionY + spacing), this.tileWidth, this.tileHeight); trace("X: " + rect.x + ", Y: " + rect.y);