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.

DarkBASIC Discussion / How to change the forground color without effecting the backround color

Author
Message
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 12th Jun 2009 22:49
How to change the color of a line without affecting the backround? Does anyone know how.


Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 12th Jun 2009 23:13
ink front,background
ink rgb(#,#,#),rgb(#,#,#)

If at first you don't succeed-Pause-Go to last checkpoint
Serial Velocity
16
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 12th Jun 2009 23:23 Edited at: 12th Jun 2009 23:27
Well you could keep your background colour in an integer when you first call the ink command:

BackColour = RGB( 0 , 0 , 0 )
Ink RGB( 255 , 255 , 255 ) , BackColour

and when you want to change the foreground colour, use this:

Ink RGB( Blah , Blah , Blah ) , BackColour

arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 12th Jun 2009 23:54 Edited at: 12th Jun 2009 23:56
you don't understand



Edit:I may have badly worded the title I want to be able to change the backround and keep the ink black but can't figure out how copy and paste the code into the editor and you'll see.


Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
pictionaryjr
16
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 13th Jun 2009 00:05 Edited at: 13th Jun 2009 00:08
Are you trying to change the color of the ink or the background or both?
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 13th Jun 2009 00:13
I want the ink to stay black and be able to change the backround by typing in the name of the color you want for it.


Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jun 2009 00:15
i assume this is for your paint program right?

here give me a min and ill code something up real quick

There are only 10 kinds of people in the world, those who understand binary and those who dont
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 13th Jun 2009 00:16
ya its for the paint program.


Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
pictionaryjr
16
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 13th Jun 2009 00:20
arbiter look at your other post i replied on it, you keep clearing the screen every cycle so your drawings arent coming up
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jun 2009 00:27
here, i saved some variables to common colors for easyness to call

do you know how rgb works arby?



There are only 10 kinds of people in the world, those who understand binary and those who dont
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 13th Jun 2009 00:29 Edited at: 13th Jun 2009 00:30
I think I know how it works but what does case mean?

edit:

on what thread?


Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jun 2009 00:32 Edited at: 13th Jun 2009 00:32
the select, endselect, case, endcase, and case default are a cool code family

select basically picks a variable (in this situation color$)

case says if the selected variable = this then do this

case default goes as the last case and says "if the variable doesnt equal any of the above then do this

endselect and endcase end the other codes in the same fashion endif ends an if

they all work together to prevent having to check for each possibility of a variable with a bunch of ifs

There are only 10 kinds of people in the world, those who understand binary and those who dont
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 13th Jun 2009 00:41 Edited at: 13th Jun 2009 00:45
oh now I get it but when I run it this part of the code is highlighted...



and it says parameter mismatch ink expects interger,interger
which means I have to use rbg or type a number rather than a variable.


Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jun 2009 00:44
no, ur putting a string variable where an integer goes, i see what you're trying but u'll have to do exactly what i did in mine, use a case system (or a bunch of ifs) and use an integer variable for the colors

There are only 10 kinds of people in the world, those who understand binary and those who dont
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 13th Jun 2009 00:48 Edited at: 13th Jun 2009 00:56
KK here is my code so far




Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jun 2009 00:51
hmmmmmmm

im seeing no reason why this isnt working, ill keep looking tho

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jun 2009 00:55
i think wat happening is the dot shows up but is deleted wen u cls

i have a plan on how to fix this although ill have to change a lot of ur code

There are only 10 kinds of people in the world, those who understand binary and those who dont
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 13th Jun 2009 00:57
How much is alot?


Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jun 2009 01:15
not as much as i thought, ill try to post it tonight but i have to work so i'll not make any promises

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 13th Jun 2009 01:19
That1SmatGuy:

I wouldn't suggest Just changing peoples code like that, the point of the forums it to learn, not say here fix this. that doesn't help him learn anythig. Help them, show them how to fix it but don't give them the fixed code.

here's the problem:



Your Mouse Routine is outside the Loop! lol i didn't see it for a little while.


Oh and if you have a input in a loop then it stops the loop and doesn't continue until the user presses enter.

By the way that isn't going to work correctly anyway.
what you need to do for the mouse is draw a line from oldx to oldy then set oldx and oldy to mousex and mousey. here's a example



Otherwise it just makes dots.

and thefor a paint program you need to get the image of the screeen every time it changes if you are going to use cls. otherwise you don't see it.

New Site! Check it out \/
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 13th Jun 2009 01:32 Edited at: 13th Jun 2009 01:39
Here's my code it just makes a dot whenever I change the color I don't get it




Vista is a paradox created by Bill Gates to force the noble pc gamers of america to console I am here to change that. [link]www.kdlproductions.webs.com[link]

Login to post a reply

Server time is: 2025-05-15 19:45:55
Your offset time is: 2025-05-15 19:45:55