Using Existing Tile Sets and TMX Maps

Any community contributions to libgdx go here! Some may get included in the core API when permission is granted.

Using Existing Tile Sets and TMX Maps

Postby MaxMS » Wed Aug 10, 2011 8:17 pm

Hi all, I had existing tile sets and maps to use in libgdx but I didn't want to split them to use the TexturePacker. Instead I have come up with a tool that uses existing tilesets to create a map file suitable for the current TiledAtlas class.

It looks for images in a directory and creates a packfile for each. The tiles must be the same size and may have optional padding in between. The files width and height must be a power of 2. The tiles themselves do not have to be a power of 2, or even square. The first tile must always start in the top left corner of the image file so any padding needs to be on the bottom and right.

This class does not require the libgdx libraries so just create a Java project, add the attached file, then create a runnable jar to execute from the command line or IDE providing the required arguments.

PackFromMap.java.txt
(5.7 KiB) Downloaded 432 times
MaxMS
 
Posts: 2
Joined: Wed Aug 10, 2011 7:58 pm

Re: Using Existing Tile Sets and TMX Maps

Postby mzechner » Thu Aug 11, 2011 2:19 am

Hey that's need. I'll move this to the contributions forum.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm


Return to Libgdx Contributions

Who is online

Users browsing this forum: No registered users and 1 guest