[SDL] Loading bitmaps with transparency?

Kein-Hong Man keinhong at gmail.com
Sun Mar 4 03:23:00 PST 2007


L-28C wrote:
> Oh, nevermind that, I'm sorry, the SDL_LoadBMP() in this Lua distro 
> loads transparent PNG's too... Sorry for the trouble! :-P

Uh, that's an over-simplification. It is best to look at working 
Lua or C demos or small programs. You can use: (a) a color key, or 
(b) an alpha channel. There is a difference. What you need depends 
on what you want to do, but I think you will need to dig into the 
documentation a bit more.

> L-28C wrote:
>> Yes, like sprites, only one part is shown... On bitmaps, there's no 
>> blank-pixel, so the background shows white... :-/
>>
>> I can't use any of the C++ libraries 'cause I'm on Lua.
>>
>> Maybe transparency masks, where there's a separate black-and-white 
>> bitmap with the black areas as the background and white areas as what I 
>> want to show? Would that be best or no?
>> [snip]

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia



More information about the SDL mailing list