2D Toolkit Forum

2D Toolkit => Support => Topic started by: test84 on December 30, 2013, 03:08:53 pm

Title: Is there anyway to import sprite sheets?
Post by: test84 on December 30, 2013, 03:08:53 pm
Hi,

I'm porting a game to 2D Toolkit and my art assets are already in sprite sheets. Is there any way to import them to 2D Toolkit and not make each sprite of that sprite sheet into separate sprite file?

If not, do you a way to automate this via a program? Because I have a fairly large amount of sprite sheets and it's unhuman to ask my artist to do it!

Thanks!
Title: Re: Is there anyway to import sprite sheets?
Post by: unikronsoftware on December 30, 2013, 04:53:56 pm
There isn't a way to import irregular sprite sheets - the easiest way to do this is to hack something into tk2dSpriteCollectionEditorSpriteSheetView.cs, AddSprites
That adds a grid of sprites splitting up a sprite sheet uniformly. You can add your own code there to extract whatever parts of your sprite sheet you need there.
Title: Re: Is there anyway to import sprite sheets?
Post by: test84 on December 30, 2013, 06:50:43 pm
Thanks for the super quick reply.

Sprite sheets are not irregularly shaped, quite the opposite, they are collection of sprites that are exactly the same size. For example a file that is 450x100 has 10 of 45x100 sprites sitting next to each other in an image. What about now, can I import them somehow into tk2d?
Title: Re: Is there anyway to import sprite sheets?
Post by: unikronsoftware on December 30, 2013, 07:11:21 pm
You can import them using this workflow here:
http://2dtoolkit.com/docs/latest/tutorial/importing_a_spritesheet.html
Title: Re: Is there anyway to import sprite sheets?
Post by: test84 on January 09, 2014, 11:04:31 am
You are a genius.