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.

Code Snippets / Using RGB command to print a character to screen.

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Apr 2006 06:52
Hi All

Might be of some use, only works with the blue value.



I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Apr 2006 07:15
Getting closer to what I was trying.

that is to change the text color in mid string.



and with text command



Now just trying to make the zero go away.

I'm not getting you down am I, Ho Look! another fancy Door?
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 27th Apr 2006 19:26 Edited at: 27th Apr 2006 19:26
no try this:

its smaller

or just
ink rgb(r,g,b),0

[/center]
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Apr 2006 20:52
I like the idea behind it. Never really thought about it like that for changing color within a text command.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Apr 2006 07:57 Edited at: 28th Apr 2006 07:59
Idea comes form the BBC basic coding where you could put a chr$(255) in the middle of a print string and that would turn the text white or what ever colour you were trying to get.

eg:

print chr$(198);"hello ";chr$(179);"world."

Jack not sure which DBPro you are using but its does not work in rc10.

I'm not getting you down am I, Ho Look! another fancy Door?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Apr 2006 11:34
jack's doesn't work, its expecting change to return a value. DBP5.8

HowDo, your changes the colors, but its also printing the color value for me.


HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Apr 2006 12:50
thats the bit that getting me down, can't seam to find away yet that stops it from showing.

I know its to do with the way I call the function .

I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Apr 2006 12:57 Edited at: 28th Apr 2006 13:41
done it.




Only one draw back, it will only work in the print command line does not work with text.(yet..)

I'm not getting you down am I, Ho Look! another fancy Door?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Apr 2006 16:12
too messy for me, It was showing the color value because you were returning the color value from the function. And given that the function is called from the print line, its outputting the result.

Simple way to fix it, either return an empty string, or return a string passed into the function that you want outputted in the color.




spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Apr 2006 17:41
or



Boo!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Apr 2006 18:17
Phaelax, spooky; I think that just about refined it, didn't know I could use "" as a way of ending a function.

cheers.

I'm not getting you down am I, Ho Look! another fancy Door?

Login to post a reply

Server time is: 2024-11-23 07:42:17
Your offset time is: 2024-11-23 07:42:17