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.

Coding > My sprites are always in front of my backgrounds :-((

#3471 - TrisOver - Tue Feb 25, 2003 4:50 pm

Why ? It's a wrong use of priorities, or it's not possible in mode 0/1/2 ?

As I can't resolve this problem, I'm using transparency to display sprites behind some backgrounds, but it's not a pretty way ...
_________________
TrisOver

#3473 - tepples - Tue Feb 25, 2003 5:34 pm

It is possible. Try setting your sprites' priority to 1 and your background's priority to 0. It should work in modes 0, 1, 2, and 4, but I don't know about the 16bpp modes.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#3494 - kiwibonga - Wed Feb 26, 2003 1:43 am

Basically, you have three priority levels, and sprites will display in front of the background(s) that have the same or a lower priority than them, like this:

[Farthest away]
BG Priority 3
Sprite Priority 3
BG Priority 2
Sprite Priority 2
BG Priority 1
Sprite Priority 1
BG Priority 0
Sprite Priority 0
[Closest]
_________________
http://www.kiwibonga.com

#3509 - TrisOver - Wed Feb 26, 2003 10:06 am

OK, my sprite properties function might have a bug.
thanks
_________________
TrisOver