Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2019-06-25 04:20:24

aiguanachein
New member
Registered: 2019-06-25
Posts: 3

Sprites over Window using ZGB

Hello to everyone

I'm making some tests with ZGB using Window as a HUD. The problem that when I make some vertical scroll, sprites appear over that window, and not in the back. I see that behavior on Zal0's first party games too.
https://i.ibb.co/FYt2wFJ/vlc-2019-06-25-10-08-18.png

Is there a way to avoid this?
Thanks in advance

Offline

 

#2 2019-06-28 22:34:26

bbbbbr
Member
Registered: 2019-03-04
Posts: 124

Re: Sprites over Window using ZGB

I believe (could be wrong) sprites are either above *both* the Window and Background, or they are below *both*. Layering for the two cannot be controlled independently. The sprite priority flag controls the above/below. If a sprite is set to behind, it will show through for any pixels in the Window and Background where color = 0.

Possible workarounds:
* Treat the top edge of the Window as bottom of the screen. That could include having a padding row of tiles at the bottom of the map the size of the Window.
* Perhaps hiding a sprite once the video controller reaches the top edge of the Window. (via moving it off-screen, changing the pallet number, toggling LCDC obj display enable for all sprites, etc).

Last edited by bbbbbr (2019-06-28 22:35:49)

Offline

 

#3 2019-06-29 06:09:32

aiguanachein
New member
Registered: 2019-06-25
Posts: 3

Re: Sprites over Window using ZGB

Thanks for the response.

I will try to hide sprites. I feel a little stupid, cause I discover this behavior in games like Kirby's Dreamland too, and never notice till now (more than 25 years later!)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson