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 the colours of the palette being used????

Author
Message
kozma_11
20
Years of Service
User Offline
Joined: 17th Sep 2003
Location: Scotland
Posted: 18th Sep 2003 02:03
hey everyone, lookin for a little help! Please!

heres the script, I have a bitmap picture with a blue rectangle in the middle. After loading it in DarkBasic, I want to change the rectangle to red without drawing another one - I want to do it by changing the blue on the palette to red!! I used to be able to do this on AmosPro on the amiga by using a command "Palette $0C0, $AAA etc....." and this would change the colours used in the bitmap to the new ones specified by $AAA (rgb combinations) up to the number of colours in the bitmap (32, 64 etc) So what I need is a similar command?? Any ideas???

Many thanks.

El Presidente
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 18th Sep 2003 05:39 Edited at: 18th Sep 2003 05:40
You can't change palletes, that only works on mode 13, 8 bit color not supported by DB, but you can use SET SPRITE DIFFUSE to adjust the RGB values of the sprite.

CTP
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Sep 2003 09:43
It can be done ... sort of

Check out the code I posted here : http://developer.thegamecreators.com/?m=forum_view&t=14962&b=4

See if that fits what you want to achieve.
kozma_11
20
Years of Service
User Offline
Joined: 17th Sep 2003
Location: Scotland
Posted: 19th Sep 2003 02:00
Thanks for your help, both of you's. I think IanM's idea should do the business. However, I'm havin a little trouble with the code. I aint sure if DarkBasic understands memblock. Is it a DBPro command?? I like the idea though of takin the image, searchin for a colour and changing it! It's exactly what I need! I dont know what dword is either! Please help me (again). Many thanks.

El Presidente
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 19th Sep 2003 06:18
memblocks, I forgot about those. good call IAN.
CTP
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Sep 2003 09:57
I've tweaked the function to be DBC compatible, but I haven't tested it - you'll need to do that yourself.

It should work as long as you are in 32 bit mode. If you want 16 or 24 bit modes you'll need to write that yourself

Login to post a reply

Server time is: 2024-05-05 12:47:34
Your offset time is: 2024-05-05 12:47:34