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 > NEED HELP: Transparent Sprite over other sprite

#18388 - kanelo - Thu Mar 25, 2004 12:01 pm

Hi. I have a little question I'm not able to solve myself. I'm trying to put one sprite above other so that the one above is transparent, and the one under is visible through. I know how to put a sprite so is transparent over the bg. I hope you could help me.

thank you very much for your time.
[/b]

#18393 - yaustar - Thu Mar 25, 2004 2:23 pm

Sorry I dont understand the question, are you trying to say that you wan to have a transperent colour on a sprite, or when a sprite overlaps another, you want it to become semi transperent ? A picture may help as well.
_________________
[Blog] [Portfolio]

#18398 - Lupin - Thu Mar 25, 2004 3:11 pm

I think you need to use color 0 for all transparent parts of your sprite.

But for semi-transparency you will have to use the hardware blending registers.

Please can you stop putting a "NEED HELP" at the beginning of each of your posts? I am sure you will get help if you need it :)
_________________
Team Pokeme
My blog and PM ASM tutorials

#18401 - kanelo - Thu Mar 25, 2004 3:31 pm

the effect I try to achieve is something like this example: imagine a bubble, then inside the bubble there is something. Yo can see what is inside the bubble with a little diferent color ( the color of the bubble ) because the thing is inside the bubble.

I'm no able to put a semi-transparent sprite above other and be able to see the sprite under.

I dont know if somebody understands what I say. Sorry for my english, but I'm not from an english speaker country.

#18404 - johnny_north - Thu Mar 25, 2004 4:25 pm

http://forum.gbadev.org/viewtopic.php?t=2677&highlight=transparent

You'll find an answer here pluss a work around.

#18408 - kanelo - Thu Mar 25, 2004 5:34 pm

Thank you for the link, that's exactly what I needed !!

But I thought GBA supported OBJ to OBJ transparency

Thank you again.

#18409 - poslundc - Thu Mar 25, 2004 5:54 pm

kanelo wrote:
But I thought GBA supported OBJ to OBJ transparency


Nope.

Dan.

#18410 - johnny_north - Thu Mar 25, 2004 6:05 pm

Well, REG_BLDMOD stores all of the transparency effect targets on the GBA - just 1 16bit register. REG_COLEY and REG_COLEV act as brightness control values depending on your chosen mode of transparency. REG_BLDMOD consists of two sections - one for the forground object and one for the background object. You can choose *all* sprite objects as either being in the foreground, background or both fg and bg of a transparency effect. However, it doesn't make sense to elect all sprites to be in the fg and bg. So you might be able to see the logic in why sprite over sprite transparency is not supported.

Just as an aside - You can elect to have only some of the sprites be affected by the transparency effect though, and this is achieved via a flag in the OAM entry for the sprite plus the selection of the proper BLDMOD mode.