XNA Creators Club Online
Page 1 of 1 (16 items)
Sort Posts: Previous Next

How to easily stitch togather sprites into a spritesheet

Last post 10/31/2009 9:41 AM by Jrett. 15 replies.
  • 9/21/2009 9:26 PM

    How to easily stitch togather sprites into a spritesheet

    I created a nice animation on toon boom animation pro(PLE) and exported to a series of images with a magenta background (for transparency).

    Toon Boom animation pro spit out 20 images perfectly.  Now I am looking for a nice application that can stitch them togather into a spritesheet.  My only requirement is that I'd like the animation to be split up onto multiple rows which in my opinion would be ideal.

    Any help?
  • 9/21/2009 9:48 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Alright friends, I found the solution

    Turns out this little GlueIt application does exactly what I need, it stitches the images togather and allows me to specify how many columns I want so it handles that also.  Has a nice little preview button so you can preview the animation before saving which is way cool

    GlueIt 1.06 temporary homepage


  • 9/22/2009 2:52 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Answer
    Reply Quote
    Nice, I use SpriteSheetCreator which was made by one of the community members.  Demesta if I recall correctly.  Very easy to use, fast, small.
    Save a virtual world, give a playtest!
    XBL/Twitter ="Talryyn"
    TalryynGames
  • 9/22/2009 4:44 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Answer
    Reply Quote
    Another solution would be to use a content processor like this sample shows: http://creators.xna.com/en-US/sample/spritesheet. Then you don't have to build the sheets manually or with a tool; the content pipeline will just do it for you.
  • 10/19/2009 10:22 AM In reply to
    • (182)
    • premium membership
    • Posts 67

    Re: How to easily stitch togather sprites into a spritesheet

    Answer
    Reply Quote
    I suppose I should have searched here before I spent the past several hours writing a sprite sheet tool of my own, but that's what I did.
    I wrote this little .NET application which is very easy to use and will simply generate a sprite sheet file for you from a directory of sequentially numbered image files.

    Please note that I just wrote this and I've generated only 6 sprite sheets, so it is not very well tested at all. Having said that, if you find any bugs in it, please let me know.

    I hope you find it as usefull as I have. You can download it here: (I think you can download it) http://cid-2bb94843841b1933.skydrive.live.com/self.aspx/SpriteSheetAssembler/SpriteSheetAssembler.exe
     

    I hope I'm not breaking any rules by posting this here.

    Jaan
    Comming soon - Mars Revenge
  • 10/19/2009 3:01 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Answer
    Reply Quote
    Nick just wrote an awesome one, and I was able to modify it to add the name of the file at the top of the sheet, name of sprite then a linebreak, rect then another linebreak, and a bool flag, it then repeats until done and adds a closing tag.

    Here is his tool: http://nickgravelyn.com/2009/10/sprite-sheet-packer-tool/

    Save a virtual world, give a playtest!
    XBL/Twitter ="Talryyn"
    TalryynGames
  • 10/19/2009 3:49 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Answer
    Reply Quote
    While we're making a list - here's the one I created not too long ago...

    http://www.crappycoding.com/2009/08/sprite-sheet-creator/

  • 10/19/2009 5:09 PM In reply to
    • (182)
    • premium membership
    • Posts 67

    Re: How to easily stitch togather sprites into a spritesheet

    Answer
    Reply Quote
    There's also a readme file. You can find both at:

     http://cid-2bb94843841b1933.skydrive.live.com/browse.aspx/SpriteSheetAssembler

    Sorry for reposting.

    Comming soon - Mars Revenge
  • 10/19/2009 11:31 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Answer
    Reply Quote
  • 10/22/2009 8:14 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    I really like Nick's tool, thanks.  I'm going to try to use it later today :)

    much appreciated everyone for both the links and the info
  • 10/24/2009 6:02 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Alright, just an update regarding Nick's Sprite Sheet Packer tool and Nicks Sprite Sheet Test sample, they both work excellent and can both be found on his blog. One thing to note is that the output of the Sprite Sheet Packer tool (.txt) file just needs to be sorted alphabetically before you test your animation.

    Nick's sprite sheet packer tool
    Nick's sprite sheet test sample


  • 10/24/2009 6:17 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    RickyWh:
    One thing to note is that the output of the Sprite Sheet Packer tool (.txt) file just needs to be sorted alphabetically before you test your animation.
    The tool isn't really for animations, though you definitely can use it for that. The tool is essentially for taking a bunch of random images and making one single image in an efficient manner. The output text wasn't sorted because the tool made the assumption that you would look up a particular rectangle by name; not by an integer index.

    That said, I've just checked in a change to the app that alphabetizes the output text file. It's useful to you for your animations, but also benefits people who may want to manually look something up inside of the output file by making it easier to find the name of the image they want.
  • 10/24/2009 7:47 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    This is an interesting tool, however it will not really work for me. I use torqueX, the sprites are usually packed like this:

    1 2 3 4
    5 6 7 8

    all the same size. No dealing with text files etc. I have also made my own sprite sheet reader the same way. I went to pack a set of sprites and they came up like this:

    6 5 2 4
    8 7 1 3

    these sprites are all the same size, etc. I don't get it. Maybe I will look at the source and see if I can adapt it for my needs, it was alot easier than the weird japanese tool I found that I cannot read.



    Henry
    My wife says most of my posts should finish with "Get off my lawn"

    smokinskull.com
    My Twitter
  • 10/24/2009 8:01 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    Well there are a couple things at play here:

    1) I do a sort by size, which I don't think is the issue if all your sprites are equally sized. However if you remove the call to Sort on line 286 of SpriteSheetPackerForm.cs you should see if that makes a difference.
    2) Because the tool does some iteration to try and optimize sizes, and because it was developed with the ability to handle lots of different sized images, it's not guaranteed to ever arrange sprites in any given order, hence the creation of the text file to tell you where each image is.

    If you're just building sprite sheets of equal sized images and know more of how you want them arrange (e.g. number in a row, number of columns, whatever), you might be better off making your own tool. This tool is really targeting the problem of packing lots of different sized images. You're more than welcome to use the UI code and any logic from this tool in building yours, but I have a feeling the packing logic this tool uses is somewhat at odds with your goals. You could more easily make a tool using a packing algorithm like this:

    - get number of images in row
    - figure out number of rows
    - get image size
    - create new image of the right size
    - do a couple of nested for loops to draw the images into the output
    - save the output file

    All of which is vastly simpler than what this tool's logic is and would be guaranteed to produce files that meet your requirements.
  • 10/24/2009 8:51 PM In reply to

    Re: How to easily stitch togather sprites into a spritesheet

    heh maybe I should just read the whole thread... The Glueit mentioned above does a great job. ; )

    Thanks for the quick response btw.


    Henry
    My wife says most of my posts should finish with "Get off my lawn"

    smokinskull.com
    My Twitter
  • 10/31/2009 9:41 AM In reply to
    • (182)
    • premium membership
    • Posts 67

    Re: How to easily stitch togather sprites into a spritesheet

    Just wanted to point out that the tool that I wrote is designed only for images of the same size. It will very easily create a sprite sheet for you. It will automatically calculate the best colums/rows numbers that will achieve the most 'square' sprite sheet, and it allows you to change that arrangement if you desire.
    Also, it will monitor the folder which you select to have your images, so that if any changes, you can press the 'Go' button again to re-make the sprite sheet. This is very helpful if you make changes and generate new image files and want to quickly spit out a new sprite sheet with the new changes.

    http://cid-2bb94843841b1933.skydrive.live.com/browse.aspx/SpriteSheetAssembler

    I've posted it on my Windows Live SkyDrive service... Feel free to download it.


    Comming soon - Mars Revenge
Page 1 of 1 (16 items) Previous Next