Is it possible to change colour of text?

Started by dangerousbrian, July 08, 2005, 08:57:51 AM

Previous topic - Next topic

dangerousbrian

I can't find any colour commands to do with text, string$, fonts etc. (it's not that important, but if its possible & doesn't slow things down too much it would look a lot better in my little programme)

kevin

#1
If your using normal windows fonts (which aren't real fast at the best of times)  you can change the colour at anytime by using the INK command

PlayBASIC Code: [Select]
Ink rgb(255,0,255)
text 100,100,"Hello"

ink rgb(0,0,255)
text 200,100,"World"

sync
waitkey


dangerousbrian

Thanks Kevin, (I couldn't find any reference to it in the help files - I must have been looking in the wrong place!)

kevin

#3
Yeah at the moment, the Help could use some help..  

You can think of INK like a PEN colour,  after you've set the INK colour most (not all) of the vector graphics command (like Dot,Line,Box etc) will use the previously set INK colour  


ie.


PlayBASIC Code: [Select]
 Ink rgb(0,0,255)
print "Ink is now this Colour"

; draw some random dots, these dots will be drawn in the previous INK colour (which will be bluely colour)
For lp=0 to 100
Dot Rnd(100),rnd(100)
next

; change the ink colour
ink rgb(255,0,0)
print "Ink is now this Colour"
; draw some more random dots in the new ink colour
For lp=0 to 100
Dot Rndrange(100,200),rnd(100)
next


; or, you can select the colour of each dot, using the DotC command
; this doesn't change the global INK colour

For lp=0 to 100
Dotc Rndrange(200,300),rnd(100),rndrgb()
next


print "see - Ink is the same"


sync
waitkey