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.

Newcomers DBPro Corner / colouring text

Author
Message
yr un olaf
18
Years of Service
User Offline
Joined: 28th May 2006
Location:
Posted: 12th Jun 2006 21:52
hi

i'm sorry this is probably a stupid question but i cant seem to work out how to change the colour of my text. could someone please explain how to do this?

thank you
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 12th Jun 2006 22:19


replace red, green, and blue with a number between 0 and 255.

Jaded Gamer
18
Years of Service
User Offline
Joined: 19th Apr 2006
Location: Iceland
Posted: 12th Jun 2006 22:42
You use the INK command, giving the forground and background colors, like this:

INK RGB(0,255,0),0
Set Text Opaque
Print "Hello World"
wait key
end

and then your text "Hello World" would be green with a black background. The set text opaque flag makes the background color show up, the default is Set Text Transparent which has the text use the screen color instead. Since the screen is normally black by default, you might want to change the colors to something else like:

INK RGB(255,0,0),RGB(0,0,255)
Set Text Opaque
Print "Hello World"
wait key
end

which would have red text on blue.

INK RGB(255,0,0),RBG(0,0,255)
Set Text Transparent
Print "Hello World"
wait key
end

will make it so that you don't see the blue, but will see red text on black.
yr un olaf
18
Years of Service
User Offline
Joined: 28th May 2006
Location:
Posted: 12th Jun 2006 22:50
thanks thats great.

so how do i set the backfround colour?
Jaded Gamer
18
Years of Service
User Offline
Joined: 19th Apr 2006
Location: Iceland
Posted: 12th Jun 2006 23:25
I think it depends on if you are using DBC or DBPro...
in DBC, my previous example:
INK RGB(255,0,0),RBG(0,0,255)
would make the background green when you did a CLS

in DBPro for the same effect you need to do:
CLS RGB(0,0,255)

Please note that all examples can use any value 0-255 for each portion of the RGB command, I just used simple colors for the examples.

My messages take a long time to appear because I am still on newbie status =(. Sorry for the delay

Login to post a reply

Server time is: 2024-11-27 17:34:33
Your offset time is: 2024-11-27 17:34:33