Sign in to follow this  
timaer

Can I set more than one ColorKey?

Recommended Posts

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 .

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This is why god invented the alpha channel in the tga file format.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Thanks all guys. It seems difficult to make two discrete colorkey, so I guess to do more stuff on the image is a alternative.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this