Posted: Sun Oct 08, 2006 11:38 am Post subject: Need help with colouring plz
I have Turing 4.0.5--Windows Version
really simple question
i am a beginer, started using turing yesterday
here's the question about colouring
i.e when i use this
colourback (10)
put "HI"
when i run it, background for whole line is green like this
i just want the background for only HI, now the whole line
plz tell me how to do it
Thanks
[/quote]
Sponsor Sponsor
Clayton
Posted: Sun Oct 08, 2006 12:31 pm Post subject: (No subject)
well, from what i remember the only you may be able to do that is to actually draw a box behind the words, because what colorback does is redesignate what the background color of your screen is (in your case green), and when you put something, it clears that line then puts the output, hence the green line.
To do this you may want to look into default sizes of font (check in your options menu, it should be in there) and create a procedure to have just the background behind your letters be colored
If you want just the actual writing to be colored, then use the color () procedure, which changes the color of your output (when using put) to the specified color
Tony
Posted: Sun Oct 08, 2006 12:36 pm Post subject: (No subject)
put includes a new-line character by default, and that clears the rest of the line, colouring it in the process.
a little hack that I would imagine would work is:
code:
colourback(green)
put "Hi"..
colourback(white)
put ""
the .. on the 2nd line forces the output to continue on the same line. This is where you switch back to the other colour, and fill the rest of the line with that.