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.

DS development > Global alpha on BG ?

#85223 - Valmond - Sat May 27, 2006 11:15 pm

Hi everybody !

My friend told me about some sort of technique which
consisted of using a "semi transparent" text background
for creating light (or shadow) effects in 2D on the GBA.
Basically some white half transparent tiles on a background
in front of the other backgrounds simulating light (by blending).

A shame he's a graphic guy ...

I bet that you can do this with the DS, but well, I haven't found
any info about setting a BG to say 50% Alpha so my question
(obviously) is, does anyone of you happen to know anything
about this :p ?


Thanks

/Valmond

#85262 - Mighty Max - Sun May 28, 2006 9:06 am

http://www.work.de/nocash/gbatek.htm#lcdiocolorspecialeffects

Might help you
_________________
GBAMP Multiboot

#85263 - LiraNuna - Sun May 28, 2006 9:07 am

Alpha blending BGs is easy as pie :)

Just use the blending register as follow (using libnds's defines, but you can check gbatek) :

Code:
 // Source is the BG with the high priority, and it will be the one to be alpha-ed
 // For DST you can use either BACKDROP for full alpha or spesific layer for clipped alpha
BLEND_CR = BLEND_ALPHA | BLEND_SRC_BGx | BLEND_DST_BGy;
BLEND_Y  = 8 | 8<<8; // 50/50 Blend

#85268 - Valmond - Sun May 28, 2006 10:20 am

This was exactly what I was looking for, thanks !

Hmm there is a Brightness Increase function too... interesting ...


Thanks again !

/Valmond