Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Changing Image Colours

Author
Message
kozma_11
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location: Scotland
Posted: 13th Sep 2004 05:19
Hi all,

Here's my problem: I'm currently making a champ man style footy management game and you have the ability to build your clubs stadium and I want the option of modifying the seat colours. So basically I have a bmp file that I want to load up on DB (not pro) and change the colour of the seats from green to say red.

Any ideas would be appreciated!

Thanks!

El Presidente
Dot Merix
22
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 13th Sep 2004 05:36
Why not just have different bmp files, and when the color has been changed, load in the greenchair.bmp, and toss out the redchair.bmp for example?

- Merix

Athlon xp 2400+, 1.0GB Ram, Radeon 9800PRO 128mb
kozma_11
22
Years of Service
User Offline
Joined: 17th Sep 2003
Location: Scotland
Posted: 13th Sep 2004 06:04
That's what I'm thinkin of doin but there something like 25 pics for each colour so if I want 10 different colours then thats 10 times as much pics that I need - seems like a waste of space if I can write a function to carry it out as required. Also, I've got small football guys that you will be able to watch score goals etc but will need to have their strips changed for each team. So if their are 400 teams to choose from then I would need to have 400 sets of animated sprites when I want to do it with one and simply change the colours as required

El Presidente
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 13th Sep 2004 07:47
Unfortunatly db is a bit lacking in these sorts of commands.
I think the only way you can do is go through the image a pixel at a time and changee the colour of the pixel if required.
The quickest way to do it will be with an image memblock.


it's cool to hate
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Sep 2004 20:32
You can make a grey seat.
Then have a rgb slider that you will have to make.
cls hidden screen with the colour of the slider.
get image from hidden screen.
put image on plain.
ghost plain.
Put ghosted plain over the seat. Or dark ghosted.
get seat image.

May need a bit of experimentation. You could also..

Get image red
Get image green
Get image blue
Put images on 3 plains
Ghost plains

Then use them combined as a colour filter.

I think you get the idea.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Sep 2004 03:57
If you can come up with a colour or colour range that you want to change, then it is possible - as long as you don't want it to be lightning fast too.

Here is a very basic example - run in 32 bit mode only:



*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2026-06-11 17:34:11
Your offset time is: 2026-06-11 17:34:11