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.

Graphics > Sprite transparency problem

#4661 - I.C.E - Sun Apr 06, 2003 5:14 pm

I have the following problem:

I have two sprites, one is sprite1 = priority 0 the other one sprite2 = priority 2. Additionally i have a priority 1 Background layer. sprite1 has transparency.

The odd thing is that if sprite2 moves to the coordinates of sprite1 you can see sprite2 though it should be covered by the Background layer.

Is that a normal behaviour? Are there any flags to correct that?

EDIT:
This effect can only occours on original hardware and not on emulator.
_________________
To this day, many C programmers believe that "strong typing" just means pounding extra hard on the keyboard.
- Peter van der Linden

#4701 - Quirky - Mon Apr 07, 2003 7:49 am

That is normal behaviour on a real GBA, none of the emulators seem to have it down yet.

Basically, the trick is don't use the "priority" flag to determine sprite to sprite priority - only use that for sprite to bg priority. Use the index in the sprite list to set your sprite to sprite z value, index 0 has higher priority than index 127.

Also you can't have sprite to sprite alpha blending, when an ab'd sprite goes over a non ab'd one, the one underneath won't show through as you might imagine.