Sign in to follow this  
Toolmaker

[MDX] Again, changing specific colorsduring runtime

Recommended Posts

Toolmaker    967
I've been working on my Dune 2 game alot lately, and I've come to the conclusion, that at the current resolution, my images are WAAAY too small. Ravuya pointed me to this great tool, called hq2x(And 3x/4x), which can enlarge images and make them look smooth. Problem: The tool outputs 24-bit bitmap, while my originals were 8 bit palettized images. I converting to 24-bits -> enlarge -> back to palette, and enlarge -> back to palette, no matter how you put it: The end results are shit. Here's an example of an enlarged sprite, which looks quite good. (Original) Now, I want to replace the red during runtime with another color. I don't mind pre-processing the images in some form, nor doing a little bit of editing afterwards, but I want to keep it to a minimum. What are my best changes of changing the colors during runtime? Using the Sprite.Draw() and supplying a Color(for instance blue) attribute doesn't work much, the entire unit ends up being blue, including the barrel and the tracks. Toolmaker

Share this post


Link to post
Share on other sites
kanato    568
well, it's kind of a gross hack, but it should work to have another image where all the red parts transparent, so it's basically the tank tracks and the barrels, and draw the image you showed with a color (maybe make that image have white tanks, so the color multiplies out better), and right on top of it draw image with just the barrels and tracks.

Share this post


Link to post
Share on other sites
Toolmaker    967
Others have said the same. I've decided to go with multi-texturing and write my own replacement for the Sprite class.

Right now, I got the quads working, so only textures to go and I'm done. After that, I could add funky effects that wouldn't have been possible with Sprite, so it's added goodness.

Toolmaker

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