• Advertisement

Archived

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

changing colour when hit

This topic is 5981 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

My problem is how to change the color of a sprite when hit. I''m using DirectDraw7 and color depth of 32-bit, so I think I can''t use CreatePalatte thing.. since you can only use it with 8-bit???? does anyone know a method to change the color??? Any ideas..... Thanks

Share this post


Link to post
Share on other sites
Advertisement
The way I do it is by using D3DX to change the RGB values of the blits, but if u dont want to convert your game to 3D, there a few ways to do it:

1) Create a mask of the sprite, change its hue to whatever color u want it to be, then alpha blend it over the sprite using the alpha code within gamedev.net.

2) Simply Create a new set of frames with the color u want and use these frames when the sprite is hit.

3) Blit the sprite, lock the backbuffer, then modify the pixels manually (though this may be slower and more complicated than the other techniques).

Hope this answers you question

  Downloads:  ZeroOne Realm

Share this post


Link to post
Share on other sites

  • Advertisement