HaxePunk / tiled

Tiled TMX import for HaxePunk
50 stars 18 forks source link

No support for external tilesets #20

Open Senevri opened 10 years ago

Senevri commented 10 years ago

When creating a tileset, the tileset entry is replaced by a reference in the tmx file like so:

- <tileset firstgid="34" name="player" tilewidth="32" tileheight="60">
-  <image source="../gfx/player.png" width="128" height="300"/>
- </tileset>
+ <tileset firstgid="34" source="player.tsx"/>

partially bad planning on Tiled's part? Perhaps. Regardless, I just broke my level.

Senevri commented 10 years ago

added the following to the if conditional in TmxTileSet.hx:

source = new Fast(Xml.parse(Assets.getText(Std.string("maps/" + source.att.source))));
source = source.node.tileset;

and made the else branch execute always.

Problem is the magic "maps/" string, which could be resolved by getting the path when tmxmap is loading from file.