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 / Transparent sprites help

Author
Message
jeffhuys
20
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 16th Mar 2011 01:07
Hi,

I'm trying to have a semi transparent sprite (colorkey).

This is my loading code:




As some of you can see, this is for a tileset.

My sprites come out fully solid. Checked the colorkey twice. Why?

Thanks!

Jeff

PS. If someone sees an inefficient part in my code, tell me 'bout it!

Mr Bigger
21
Years of Service
User Offline
Joined: 31st Jan 2005
Location: was here!
Posted: 16th Mar 2011 03:42
You may just need to add a texture flag of 1 to the load image line so you get a pixel perfect image.



AMD 2600+/1GB ram/GeForce 6600oc 256MB/W2KPro/DBPro 6.6.b
jeffhuys
20
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 16th Mar 2011 15:25 Edited at: 16th Mar 2011 15:32
No, you see, the problem is that my colorkey (Set Image Colorkey 229, 190, 255) doesn't work.
It doesn't delete that color from the images. Adding that flag does not make any difference.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Mar 2011 15:48
PNG images contain their own alpha channel, so don't use the colorkey system.

You can either add the alpha correctly to the PNG images, or switch to an alternate image format (eg BMP).

jeffhuys
20
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 16th Mar 2011 17:06
@IanM:

Thanks, that works!

Jeff

Login to post a reply

Server time is: 2026-07-17 13:58:27
Your offset time is: 2026-07-17 13:58:27