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.

Dark GDK / dbSetImageColorKey problem

Author
Message
Charles Black
16
Years of Service
User Offline
Joined: 9th Mar 2008
Location:
Posted: 21st Oct 2008 20:43 Edited at: 21st Oct 2008 20:44
Well, I recently downloaded DarkGDK and when I began to code my program, I created a small sprite with a magenta (255,0,255) background.

Now, I want this background transparent, but, when I use the following function:




Nothing happens to the image.
This is my current code:




I'd be grateful if anyone helped me.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 21st Oct 2008 21:32
Try moving your dbSetImageColorKey () ahead of your dbLoadImage() call.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Charles Black
16
Years of Service
User Offline
Joined: 9th Mar 2008
Location:
Posted: 21st Oct 2008 21:47
OK, so I tried it in three different positions ( before the first dbLoadImage, inside the loop before and after the sprite creation) and it still didn't work.

I also noticed that in the template for Dark GDK - 2D game it does exactly what I'm trying to do - loads background, sets image color key, then creates a bunch of sprites.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 21st Oct 2008 22:02
The only other thing I can offer is that maybe your "transparent" portion isn't precisely <255, 0, 255>.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Charles Black
16
Years of Service
User Offline
Joined: 9th Mar 2008
Location:
Posted: 21st Oct 2008 22:12
It is 255,0,255, I'm pretty sure. I used Photoshop CS2 to edit the file.
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 21st Oct 2008 22:27 Edited at: 21st Oct 2008 22:29
You change this. .png to .bmp
Charles Black
16
Years of Service
User Offline
Joined: 9th Mar 2008
Location:
Posted: 21st Oct 2008 22:29 Edited at: 21st Oct 2008 22:39
Oh.

Thanks! I'll try that out right now.
I'll edit here with the result.

EDIT: IT WOOOORKS!

Now I only have to figure out how to make the pixels EXACTLY 255,0,255 (all the pixels around my sprite are a mix of yellow and pink )

EDIT 2: I just realized I could've just used a transparent background when creating the image on PSCS2. >.>

EDIT 3: I can't get the sprite to move... the function I'm using is



any suggestions?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 21st Oct 2008 23:35
Try MSPaint.

Login to post a reply

Server time is: 2024-11-25 06:34:05
Your offset time is: 2024-11-25 06:34:05