🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Tiled .tmx Map to Texture Atlas libGDX

Started by
1 comment, last by macmanmatty 5 years ago

I have some  tiled tmx maps I made. I have  a texture atlas that contains all of the textures I'm using in my libGDX game . I have a  json tiled map saver class  I wrote that stores the atlas region name(s) of the texture for the tiled map tile  or animated tile  as well as any  other info like  flipped, tile  color,  tile brightness,  ect.  That class  saves my tiled map  to json and loads it from json using the texture atlas to retrieve the  texture regions  .  Most of my map is procedurally generated  at run time with some parts I created in the tiled program saved in .tmx format . I need to save the entire map (both procedurally generated and the added  .tmx parts (that may have changed  since first loading). The two parts get mixed together and changed somewhat to become  one tiled map. My problem is I can't figure out how to get the atlas region name  from   the texture region that is loaded with the .tmx map or create a new atlas region. I can create a new texture atlas  with libGDX and add new  texture regions to it and give them atlas names to save the map ,   but then how do I save the newly created texture atlas  along with the  packed images at run time?

Advertisement

I solved this issue!  If I use  a collection of images in tiled.   I can get the file name for each image in the properties   section of the tile in libGDX. which I can then  turn into  the atlas Region name and save it.

 

 

This topic is closed to new replies.

Advertisement