Hello Guest

Author Topic: Please help with sprites and spritesheets  (Read 4213 times)

piginhat

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Please help with sprites and spritesheets
« on: March 06, 2016, 11:17:34 am »
Hi,

I am very confused about how to create sprite sheets from my sprites and for that matter the original dimensions of my sprites.

I have a character that has the sprite (image) series for idle, walk, jump, fly, crouch and holding gun.

Now dependant on which series I use the images of the character take up more space so for example walking is 80 x 140 pixels with the bounding box aligned to the outermost edge of the character.  But the flying series where the character opens its wings and leans forward is 102 x 140 and when the holding gun where it holds its gun out is 120 x 140

If I then have this in a spritesheet I cannot get the bounding boxes set correctly when trying to setup as a sprite collection

Question #1
Is it the case that I need to take the largest size required to accommodate the character using most space, the holding gun one, and then make all other series this size even though there will be large areas of transparency, does that not make for a much larger than required spritesheet image?  I thought the idea of the spritesheet was to cram in as many images as possible to save space?

Question #2
When I have all the sprites eventually in my sprite collection do I then need to select each and every sprite in the collection and add a collider to exactly match its shape given each frame(sprite image) does not match the previous frames collider?




 

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Please help with sprites and spritesheets
« Reply #1 on: March 07, 2016, 09:52:36 am »
You don't have to care about spritesheets - tk2d will optimise and merge your sprites into a sprite collection atlas. Only draw into a spritesheet if it makes sense / makes it easier to manage your artwork.

Q1: there isn't any problem in having empty / 0 alpha space in there, they all get trimmed and cropped anyway.

Q2: Yes, but you should probably just use a box for the character collider rather than trying to have a complex collider on each frame for performance and stability.

piginhat

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Please help with sprites and spritesheets
« Reply #2 on: March 07, 2016, 12:49:40 pm »
Thanks, I was just out walking and thinking the spritesheet thing through and then realised...duh??  Sprite Collections!

 ;)