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 > Background priorities

#3512 - Psyk - Wed Feb 26, 2003 12:01 pm

How do i set the priority of a background? I assume its in REG_BGxCNT but which bits?

#3516 - jenswa - Wed Feb 26, 2003 2:26 pm

somewhere (in bg.h for instance) you might have or want to declare:

Code:
#define BG_PRIORITY(x)      x


that way, you can use BG_PRIORITY(x) where x=0,1,2,3 and
x=0 is the top and x = 3 is the lowest priority.

But just to simplify, put the background you want in top in background 0
and the one you want at the back in background 3, etc..

either way will work fine.
_________________
It seems this wasn't lost after all.

#3519 - tepples - Wed Feb 26, 2003 4:14 pm

jenswa wrote:
But just to simplify, put the background you want in top in background 0 and the one you want at the back in background 3, etc..

That is, of course, unless you're using mode 1 and want the playfield (BG 2) between the backdrop (BG 1) and the HUD (BG 0). Then you'll have to switch their priorities.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.