Can I set more than one ColorKey?

Started by
5 comments, last by timaer 18 years ago
Hi, everyone, I need to set more than one ColorKey, is it possible? if I set the color key as below ddcolorkey. dwColorSpaceLowValue= RGB(A, B, C); ddcolorkey. dwColorSpaceHighValue= RGB(D, E, F); and the transparent color range will likely be RGB(A, B, C) to RGB(D ,E ,F) so what if I need to set exectly two color, such as blue and green, How can I do it? Any one know it ? Thanks .
Advertisement
I'm pretty sure you can only set a color key range rather than two or more discrete colors.
Quote:Original post by EasilyConfused
I'm pretty sure you can only set a color key range rather than two or more discrete colors.

Yup. And many video cards (ie: basically everything but gForce or Radeon series) only support one transparent color in DirectDraw.
Wouldn't it be easier to just save off the master image to a separate image, then alter the image so that it only needs one colour key instead of multiple?
"Leave it to the computer programmers to shorten the "Year 2000 Millennium Bug" to "Y2K." Isn't that what caused this problem in the first place?"
This is why god invented the alpha channel in the tga file format.
No, but you can create a class that does this for you, in fact I have one i developed a while back for a similar purpose (for a 64kb game contest). Simply keep a "base" sprite, and then a "catched" sprite, which converts all of the colorkeys to one color. That wasnt the primary purpose for the system though, and honestly if you are just in need of multiple color keys there may be a better way of doing it. It just so happened in my engine i found it usefull to embed transparent "node locations" without making a custom file type.
Thanks all guys. It seems difficult to make two discrete colorkey, so I guess to do more stuff on the image is a alternative.

This topic is closed to new replies.

Advertisement