gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Sprite Sheet Dimensions

#22559 - MattBH - Thu Jun 24, 2004 4:50 am

I'm pretty new to the GameBoy scene and I was running through the tutorials found at:
http://www.aaronrogers.com/ham/Day8/day8.php

Everything was pretty straightforward and easy to follow, but I've run into one problem. On the animation tutorial (which is the one I linked to above), I tried to use one of my old sprite sheets. This caused a problem where the first few pixels of the characters head would be displayed several times to make up the 32x32 sprite, instead of showing the correct frame. I narrowed this down to the way the sprite sheet is set up. If I make the sheet exactly 1 character width across, and however many tiles down, the sprite is displayed correctly. However, when I try to make the sheet with say 4x4 frames, it doesn't work. It always needs to be 1xwhatever. Is there anyway around this or do the sprite sheets have to be created in this awkward fashion?

Thanks,
Matt

#22569 - poslundc - Thu Jun 24, 2004 1:50 pm

The GBA uses 8x8 pixel tiles for all of its tile modes. If you want, say, a 32x32 sprite, you have to load it in with sequential 8x8 tiles.

It's up to your conversion program to go from your sprite layout into a format that makes sense to the GBA. Your program most likely won't know that your layout is broken up into 32x32 chunks unless it is designed to handle that, and you tell it.

So, either find a conversion program that meets your requirements, or go ahead and write your own (as I and many others on this board do).

Dan.

#22571 - tepples - Thu Jun 24, 2004 2:41 pm

There are two easy ways to tell a typical "dumb" image conversion program the size of each sprite cel:
  • Place all cels one on top of another in an image as wide as the cels, and use 1D mapping mode.
  • Place all cels side-by-side in a 256-pixel-wide image (or 128-pixel-wide for 8bpp cels), and use 2D mapping mode.

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.