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 question

Author
Message
xbandages
14
Years of Service
User Offline
Joined: 30th Mar 2010
Location: Michigan
Posted: 3rd Apr 2010 05:41


This function is called before the darkGDK game loop. But I cannot change this value in the loop, why? I have tried to change it to extreme values at different parts of my code, but it only keeps its initial value. I need to be able the change the transparent color for a moment in order to use my collision detection system.
Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 3rd Apr 2010 18:44
This was a somewhat interesting question since i've never tried changing the color key in loop so i did a quick test.

From what it appears is that once you set the color key all images that are loaded are assigned that color key, but if you change the color key then it will only be assigned to any new images loaded after that. The thing i liked was that even though the color key changed all the images that were loaded with the previous color key retain that color key.

here is the quick test program i made...


... theres 2 images test1.bmp with a magenta(255, 0, 255) background and test2.bmp with a black background.

As to your collision system, you should be able to make it work without changing the transparent color. I'm not exactly sure how your doing it so i cant really give any more help, though if you posted some of what your working on i'm sure someone could give you a nudge in the right direction.

Login to post a reply

Server time is: 2024-07-13 09:15:39
Your offset time is: 2024-07-13 09:15:39