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 > Adding text over a sprite

#52113 - blacksun - Fri Aug 26, 2005 8:32 pm

Ok, what I am trying to do is to write a number over a sprite. What I do for text is write it directly to video memory, 0x700:00. This will display over the background but will be hidden behind a sprite. I set the sprite priority to the lowest and still no affect. I haven't found a great way to display text so I'm sure there is some priority how everything is displayed.

Also, I saw in another topic, the bejeweled clone, that it was suggested to use background tiles as the squares in a grid-based puzzle game. How exactly would I go about this? Would I just use one background for the tiles and keep updating their values as the pieces move?

I am also creating a grid-based puzzle game, but of my own design and I see myself exceeding the 128 limit for sprites so I am trying to find ways to fix this.

#52117 - poslundc - Fri Aug 26, 2005 10:26 pm

blacksun wrote:
Ok, what I am trying to do is to write a number over a sprite. What I do for text is write it directly to video memory, 0x700:00. This will display over the background but will be hidden behind a sprite. I set the sprite priority to the lowest and still no affect. I haven't found a great way to display text so I'm sure there is some priority how everything is displayed.


Try setting the priority values up... 0 is highest priority on the GBA, and 3 is lowest.

Quote:
Also, I saw in another topic, the bejeweled clone, that it was suggested to use background tiles as the squares in a grid-based puzzle game. How exactly would I go about this? Would I just use one background for the tiles and keep updating their values as the pieces move?


That's the basic idea. And use sprites when you want to fluidly animate individual pieces of it. Some game designs work better with this than others.

Quote:
I am also creating a grid-based puzzle game, but of my own design and I see myself exceeding the 128 limit for sprites so I am trying to find ways to fix this.


A background would be the easiest/most practical way in most circumstances.

Alternatively, you can multiplex your sprites to get around the 128-sprite limit by changing the OAM entries during the HBlank period several times as the scanline counter advances while the frame is rendering. This is an advanced technique with many pitfalls, though, and not to be embarked upon lightly.

Dan.