Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Turn an image color to alpha (invisible)

Author
Message
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 28th Oct 2010 18:35
Hi, is it possible to turn a color (blue for example) invisible on a sprite ? It's possible with SDL in C language, but I've not found commands in DBPro, just the "set sprite alpha".

It's very important for me, I would want play an animation to an image and turn the blue color to invisible, the blue is the animation background.

Thanks.

Eternal suffering ...

I'm french
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th Oct 2010 18:40 Edited at: 28th Oct 2010 18:41
"Set image colorkey" but you have to do it before you load the image (I think)...

bergice
19
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 29th Oct 2010 00:51
Quote: ""Set image colorkey" but you have to do it before you load the image (I think)..."


Thats true.

Not sure if you have to set sprite transparency to true too, try it out without first.

Oh and if you are unsure about the exact color you can open the image in Paint (or w/e you would like) and use Color Picker to select the color and opening the Custom color window and you can see the RGB values there.

51fa1db0ec7c4af52d93a6f5d0e86bc5


Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 29th Oct 2010 15:10
Ok, thanks

Eternal suffering ...

I'm french
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Oct 2010 16:47
Also note that this only works with BMP images or images with no alpha channel. PNG images for example have their own alpha channel, so you would have to make the parts you want transparent in the editor.

TheComet

Login to post a reply

Server time is: 2026-07-22 04:37:12
Your offset time is: 2026-07-22 04:37:12