Can I set more than one ColorKey?
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 .
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?
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement