Archived

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

changing the pallette colors for each individual graphic

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

I posted a similar post in turbo. But i figure someone in "isometric area" has come across this type of situation... Im making a isometric game simliar to rollercoaster tycoon. Im not sure how they change the colors on each of the rides - But since you can make the rides ANY color - im sure they didnt create each piece of the ride in every color imaginable. I think they change the pallette for each image to allow the user to select whatever color they want for each piece of the ride. Has anyone ever done this using Directx? If so... how is it done? - it would help me out if someone has done this in DelphiX but perhaps some puedo code would work too...anyway... Thanks Bill

Share this post


Link to post
Share on other sites
I believe Roller Coaster Tycoon uses a 3d renderer, but you could probably implement it in 2d-iso using some simple code (at least it''s simple in 8-bit mode ) and assign a few colors out of the palette that are designated "special colors"; then your code can change those colors based on what color the user has selected. This wouldn''t work for too many different tiles, though, because you''d run out of unique palette entries.

Share this post


Link to post
Share on other sites
Yeah RollerCoaster is full 2D but it looks like awesome 3d graphics. I''m not sure but mabe they rendered the graphics in 3d.
The tracks behave like if they were in 3D but they are very much 2d.

Share this post


Link to post
Share on other sites
Yeah - im sure they''re pre-rendered 3d graphics - but how can you change the track, cars, and rides to ANY color in the game?

There''s way too many colors and ride pieces to have pre-rendered each with a different color - theres some sort of way to change the RPG value/palette of each piece of the ride (graphic image)

Anyone know the exact directx syntax to do this?

Thanks

Share this post


Link to post
Share on other sites
Read about DirectDrawPalettes in the SDK to find out how to use them. Allocate a certain number of colors in the palette to use as your "team" colors.

For example:
In your default palette you would want to set color entries 1-10 to a color like magenta. So now you have 10 shades of magenta. When you are coloring your graphics, use the 10 magenta colors for the parts that you want to be changed in the game.

Now create your "team" palettes .. just change those 10 magenta shades to say .. 10 red shades. Save the palette and repeat the process for each "team".

Okay, so lets say you have 5 color palettes (default, red, green, blue, orange), in your code create 5 DirectDrawPalette objects, and set each one to one of the palettes .. now when your drawing your sprite, just attach whichever palette you want to the surface. That should change the "Team" colors.

Hope that helps

Oh, and I would use a program like Paint Shop Pro to create the palettes, but there may be some other software out there specifically for this purpose.

[edited by - mstrmynd on May 6, 2003 12:50:15 PM]

Share this post


Link to post
Share on other sites