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.

DS development > Text over Sprites

#113810 - zon7 - Sat Dec 30, 2006 11:19 pm

I know is a newbie ask, but I have been trying it and I can make it work.
Actually, I have been able to write text over the background, using some code from the forum, but I can't find antwhere code to write text over Sprites.
Here is a capture
[Images not permitted - Click here to view it]

I have the text like this:
BG0_CR = BG_MAP_BASE(31) | BG_PRIORITY(0);

I forgot. I'm using mode 5
videoSetMode( MODE_5_2D |
DISPLAY_SPR_ACTIVE|
DISPLAY_BG3_ACTIVE|
DISPLAY_BG0_ACTIVE|
DISPLAY_SPR_1D
);

How can I solve it?
Thanks


Last edited by zon7 on Sat Dec 30, 2006 11:24 pm; edited 1 time in total

#113811 - Lick - Sat Dec 30, 2006 11:23 pm

Set the sprite priority either 1, 2 or 3. I am guessing that it's currently defaulted to 0.
The priority of a sprite is set in attribute2. ATTR2_PRIORITY(), I don't really remember.
_________________
http://licklick.wordpress.com

#113813 - zon7 - Sat Dec 30, 2006 11:28 pm

Actually, it's set to 3
spriteEntry[i].attribute[2] = ATTR2_PRIORITY(3);

#113814 - Lick - Sat Dec 30, 2006 11:41 pm

Are you sure that it's BG0 that's in the middle? Could it not be another BG that is displaying BG0's vram?
_________________
http://licklick.wordpress.com

#113815 - zon7 - Sat Dec 30, 2006 11:53 pm

Well, finaly I added some code to change the priority of the sprite.
The text was efectively at BG0, but I don't know why, the sprite is only under the text with priority 1-5-9-...
Well, at least it works.

I have try changing the text to BG1 but I get the same result so it will have to work.

Thanks a lot for your help