Archived

This topic is now archived and is closed to further replies.

Harvester

How to ColorKey?

Recommended Posts

Harvester    122
Greets. I need some information regarding the creation of color keys. With 32, 24 and 16bpp, everything looks great and easy. However, if an indexed mode (palette) is used, how do i define and set the color key? Also, when a surface is made so that it holds an alpha channel (of some bits), when in 24bit and 16bit modes, what is really changing? p.s. I checked the DDPF_ related material, but i found no info regarding the above stuff. Thanks.

Share this post


Link to post
Share on other sites
Staffan    122
Doesn''t colorkeying in palettized modes work as usual?
Did you try giving it an index instead of an color? I''m assuming you''re relying on DirectX, I also assume you''re only doing 2D stuff. As for alpha channels..I don''t think any of this is supported by DDraw, I know actually getting the alpha values to do any good isn''t.

"Paranoia is the belief in a hidden order behind the visible." - Anonymous

Share this post


Link to post
Share on other sites
furby100    102
What you give the function are palette indexes rather than RGB colors. So if you want color 0 to be the transparent color, you just say 0. If you want 255 to be the transparent color, you say 255. The fact that indices can be reassigned their colors at runtime makes no difference whatsoever.



Please state the nature of the debugging emergency.


sharewaregames.20m.com

Share this post


Link to post
Share on other sites
Harvester    122
What if we have an alpha channel on the surface?
RGBA color format.

I found on the DX help some more formats that include this. However when i define some trans color, it doesn''t really work! What am i missing?

Share this post


Link to post
Share on other sites