Jump to content
  • Advertisement

Archived

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

Irrelevant

directdraw fade effects with color keying question

This topic is 5738 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Say I have a gray-scale bitmap of a shield effect. Is there a way to make it look like it''s fading or changing color and intensity over time? I would settle for a simpler version such as a bitmap of a single color (ie white) on a black background. Then using color-keying, the background of black isn''t drawn, but the white part is, could I use colorfill to change the color of what is drawn?

Share this post


Link to post
Share on other sites
Advertisement
I think you could use palette animation. I''ve never used it myself though so you''ll have to ask somebody else of the specific details. It basically comes down to shifting the palette for each part of the animation, as the 8-bit palette bitmap will then be drawn in different colours.

Share this post


Link to post
Share on other sites
I think I have a way now (remarkably inefficient, but hey...) to accomplish color fading using color keying.
OK, I have a primary surface, a back buffer, and a third offscreen surface that contains the images for the game. Black is always transparent. White is used where color is changed. There is a large blank area in the image surface. Say I want to draw the shield with some color value. I blit the shield section of the image surface onto the back buffer (using source color keying so the white shield part is only copied, not the black space where the ship will show up). Then, I do the computation to get the desired color value. Using the size of the shield image, I do a color fill on the image surface (in the blank area) using the desired color. Now, using destination color keying, I blit the color-filled rectangle off the image surface to the same spot as the white shield drawing on the back buffer. It will fill in the white with the new color.

Is there a faster way to do this? I''m going to try this now I think and see what kind of performance it gives.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!