Tiled, TexturePacker2 and Libgdx

Anything libgdx related goes here!

Re: Tiled, TexturePacker2 and Libgdx

Postby BurningHand » Sat Aug 04, 2012 9:25 pm

I usually just use my own code - which typically consists of a few int arrays, an array of texture regions, and a SpriteBatch or SpriteCache. :shock:
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2464
Joined: Mon Oct 25, 2010 4:35 am

Re: Tiled, TexturePacker2 and Libgdx

Postby MarkB » Sat Aug 04, 2012 9:32 pm

Bah I was afraid you'd say that. Guess that's what Ill have to figure out then :?
MarkB
 
Posts: 30
Joined: Tue Jul 31, 2012 8:47 pm

Re: Tiled, TexturePacker2 and Libgdx

Postby Varriount » Sun Aug 05, 2012 4:52 am

Well, if all you want is a simple tile based map game, you could just make one without using Tiled. (Or even make a Tilemap tool that allows the creation of levels via gui, and saves/loads using custom loaders)
Think of the unanswered posters : search.php?search_id=unanswered
If I'm you and you're me, then who's he?
Varriount
 
Posts: 249
Joined: Tue Jun 05, 2012 2:48 pm

Re: Tiled, TexturePacker2 and Libgdx

Postby dud3z » Sun Aug 05, 2012 8:12 am

MarkB, have you tried out the samples/tests that come with libgdx? I've used one of them to learn how to use the actual implementation, that should work for you too: something i had problems figuring out at first was how to reference the tileset itself.
In your TMX file, you should have something like:
Code: Select all
 <tileset firstgid="1" name="tileset" tilewidth="224" tileheight="224">
  <image source="tilesets/nature/224.png" width="896" height="3360"/>


That is, it looks like the map should reference the tileset as a relative path: in the directory containing TMX files i've the "tileset" directory containing various tilesets (nature/...) and then the TexturePacker2 packed resources.
Don't know if you already tried, but this thing was the only problem i had with the current Tileset implementation.
dud3z
 
Posts: 123
Joined: Wed Jan 04, 2012 1:10 pm

Re: Tiled, TexturePacker2 and Libgdx

Postby MarkB » Mon Aug 06, 2012 3:54 pm

Yeah tests/samples/all that jazz are fine EXCEPT for tiled maps. I have no idea what the problem is. Gave up entirely on writing my own code temporarily and wholesale copied the tiled map stuff from dpk.net. That wont work for me either.

I even reinstalled java this morning in the hopes that might help, grabbed the newest nightly libgdx build too and replaced the necessary jars, still no joy. Driving me mad now...
MarkB
 
Posts: 30
Joined: Tue Jul 31, 2012 8:47 pm

Re: Tiled, TexturePacker2 and Libgdx

Postby dud3z » Mon Aug 06, 2012 9:21 pm

But are we speaking about the desktop platform? Is it not working even on the pc?
dud3z
 
Posts: 123
Joined: Wed Jan 04, 2012 1:10 pm

Re: Tiled, TexturePacker2 and Libgdx

Postby smoak » Wed Aug 08, 2012 4:28 am

BurningHand wrote:I usually just use my own code - which typically consists of a few int arrays, an array of texture regions, and a SpriteBatch or SpriteCache. :shock:


How do you maintain aspect ratio using this method? I've gotten my own "tile engine" working using a similar way(Int array, Texture, and SpriteCache), but the tiles end up getting stretched. No amount of camera configuration works (perhaps I should make my own thread?).
smoak
 
Posts: 3
Joined: Wed Aug 08, 2012 4:25 am

Re: Tiled, TexturePacker2 and Libgdx

Postby Varriount » Wed Aug 08, 2012 7:30 am

psh, you java programmers and fixation with threads.. :D
You could always use scene 2d, and have it maintain aspect ratios.
Or, if you want to do it manually, create a camera with dimensions the same as the screen, and use virtual units for positions
Think of the unanswered posters : search.php?search_id=unanswered
If I'm you and you're me, then who's he?
Varriount
 
Posts: 249
Joined: Tue Jun 05, 2012 2:48 pm

Previous

Return to Libgdx

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 4 guests