RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
Ichoris
Pretty, Pretty Fairy Princess


Joined: 20 May 2009
Posts: 6

PostPosted: Wed May 20, 2009 3:18 am    Post subject: Sprite Packing Tool [quote]

Does anyone know of a good tool for packing sprites/textures?

I want to feed it a bunch of .PNG (24 bit with alpha) and have it spit out a new .PNG (24 bit with alpha) where the sprites are all packed together on a page.

The page size needs to be a power of 2 (128x128, 256x256, 512x215, 1024x1024). The tool should also write out a file which contains the offsets (UV) and width and height to each sprite.

I have seen a few tools but none seem to keep the alpha infromation for the input or output .PNG files. Any help would be awesome.

Thanks!
Back to top  
Mattias Gustavsson
Mage


Joined: 10 Nov 2007
Posts: 457
Location: Royal Leamington Spa, UK

PostPosted: Wed May 20, 2009 7:29 am    Post subject: [quote]

I don't know of a tool, but it's not that difficult to write one. If you're using C++, you could probably get this code to work quite easily: http://www.colossusentertainment.com/forumref/lib2d_imgpack.zip (it's public domain, so if you can use it, please do)

It's from an ooold engine I made long ago (back when I believed in using 3D hardware for 2D games *lol*) and it's not perfect (there's some wasted space, as marked with red/green fields:


It outputs an XML file on this form, which is quite handy:

_________________
www.mattiasgustavsson.com - My blog
www.rivtind.com - My Fantasy world and isometric RPG engine
www.pixieuniversity.com - Software 2D Game Engine
Back to top  
Ichoris
Pretty, Pretty Fairy Princess


Joined: 20 May 2009
Posts: 6

PostPosted: Thu May 21, 2009 3:37 am    Post subject: [quote]

Thanks! Your tool does exactly what I need. I will take a look at the code. Thanks again!
Back to top  
Mattias Gustavsson
Mage


Joined: 10 Nov 2007
Posts: 457
Location: Royal Leamington Spa, UK

PostPosted: Thu May 21, 2009 12:38 pm    Post subject: [quote]

Sure thing :-) And if there's any questions about the code, I'll be happy to answer. Unfortunately, the code is old and doesn't compile anymore, and there's parts of it I'm not at liberty to disclose, or I would make all of it available...
_________________
www.mattiasgustavsson.com - My blog
www.rivtind.com - My Fantasy world and isometric RPG engine
www.pixieuniversity.com - Software 2D Game Engine
Back to top  
Ichoris
Pretty, Pretty Fairy Princess


Joined: 20 May 2009
Posts: 6

PostPosted: Tue Jun 09, 2009 5:24 am    Post subject: [quote]

Thanks. I was able to get my tool working. I just wrote my own version (in JAVA so works on MAC and PC) but it was helpful to see how you did some things. Very useful. Thanks again.

I'm trying to add some new things to it. I had another question posted here:

http://forums.rpgdx.net/viewtopic.php?t=2187
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum