Page 1 of 1

Working with sprites

Posted: Fri Aug 07, 2015 10:49 pm
by randomNick
Heya guys, for the first time i want to try and develope a 2D platform fight game.

For the code im using the AnAL library for the animation, but the issue im having is with the sprites.

For instance this animation Image

The width isnt the same for all the frames, so i was wondering how do people usually deal with this. Do u use any programs or do you work manually and create a new sprite sheet?

Re: Working with sprites

Posted: Sat Aug 08, 2015 2:51 am
by Jasoco
Well, either make the areas for each of the sprites the same size and move each image into the correct position, or add some x and y offset to the animation metadata to offset it correctly. It really depends on the game and the maximum size of the sprite overall when all frames are stacked on top of each other.

I don't know if AnAL allows for the offset so you might need to just make each quad the same size.

Re: Working with sprites

Posted: Sun Aug 09, 2015 4:02 am
by Ulydev
I +1 this, That would be so awesome if we could actually specify each frame's dimensions :awesome:

Re: Working with sprites

Posted: Sun Aug 09, 2015 8:05 am
by zorg
Ulydev wrote:I +1 this, That would be so awesome if we could actually specify each frame's dimensions :awesome:
If you write your own solution, you can though. And if space is tight, you need all the "compression" you can get, ie. not waste pixels on empty space just for equal frame sizes. But if it isn't, then you might as well make them the same size.

Re: Working with sprites

Posted: Sun Aug 09, 2015 7:58 pm
by Ref
Not really what you want but just screwing around waiting for a fix for my messed up computer - a result of upgrading to Windows 10 (drivers overwritten).

Re: Working with sprites

Posted: Sun Aug 09, 2015 9:29 pm
by davisdude
*cough self-advertisement cough*
You could try out my animation library, which allows you to use different sized images, among other things. It's not really tested yet, so you might be better off with Kikito's anim8.

Re: Working with sprites

Posted: Mon Aug 10, 2015 7:59 am
by T-Bone
If no existing library suits your needs, don't feel afraid to implement your own. It doesn't have to be difficult, and you get precisely the behaviour you want.