TV Text object confusion - How to make a TV do what it must
ElectricAye
Posts: 4,561
Hey all,
I want to spruce up my TV output·and I've been·trying to decipher how to actually make the TV_Text object do what I want.· I'm not out to do anything fancy, just change colors of text and background, maybe scroll the screen, etc.··Methods like out() confuse me because I don't know how to set them up.· While .out($00)·clears the screen, I'm baffled at how .out($0C) is supposed to set a color.· Where·do the color·code instructions go when you call the .out()· method?· And what are the color codes???· Equally baffling is the .setcolors() method.· How is that used in a line of spin code?
And·there are no comments to even tell me what .newline·does.· Does it scroll the screen?· Draw a line?
Also freaking me out, I see the following in the TV_Text_Demo:
· text.str(string(13,"·· TV Text Demo...",13,13,$C,5," OBJ and VAR require only 2.8KB ",$C,1))
I understand what 13 gives me, but what's $C,5 do?
Is there a downloadable somewhere that describes all of this stuff?
thanks,
Mark
I want to spruce up my TV output·and I've been·trying to decipher how to actually make the TV_Text object do what I want.· I'm not out to do anything fancy, just change colors of text and background, maybe scroll the screen, etc.··Methods like out() confuse me because I don't know how to set them up.· While .out($00)·clears the screen, I'm baffled at how .out($0C) is supposed to set a color.· Where·do the color·code instructions go when you call the .out()· method?· And what are the color codes???· Equally baffling is the .setcolors() method.· How is that used in a line of spin code?
And·there are no comments to even tell me what .newline·does.· Does it scroll the screen?· Draw a line?
Also freaking me out, I see the following in the TV_Text_Demo:
· text.str(string(13,"·· TV Text Demo...",13,13,$C,5," OBJ and VAR require only 2.8KB ",$C,1))
I understand what 13 gives me, but what's $C,5 do?
Is there a downloadable somewhere that describes all of this stuff?
thanks,
Mark
Comments
Several of the display "commands" require two bytes. The first is the command code (like $0C) and the second is the parameter. For setting the color, you'd do .out($0C), then .out(color) where color is a value from 0 to 7.
The color number is actually the index into a table of longs containing the color information in the 4 bytes of each long. During its initialization, the TV_Text object sets up this color table with default values. There's a palette display demo program that shows the actual displayed color for each of the 256 byte values. Each displayed character can have a foreground color and a background color. Look at the setcolors method in TV_Text.
tvtext.out($0c) if followed by tvtext.out(5) ( which is the same as the $c,5 that you wish to know what it does )
will set the palette to the 6th ( since 0 is also a number ) palette which is green text on a grey green background, if you have the palette set as below.
To set these colours up, you use the tvtext.setcolors(@palette) function.
And tvtext.out($0d), is the same as tvtext.newline which sends the printing coordinates ( an invisible cursor if you wish ) to the left and down 1 line, unless it's at the bottom line, in which case it will then scroll the whole screen text up leaving a new blank line, for any following text to appear on.
I hope this clears it up a bit for you [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
Ahhhh, that's the kind of sneaky stuff I was looking for!
Thanks, Mike!
And Baggers, thanks to you for explaining that string of code. Now the clouds are beginning to clear.
WOW, you guys are really fast, too!
cheers,
Mark
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
in the demo area of the Propeller tool and I believe it is also available in OBEX.
This displays all the colors that the prop can manage and gives you a mouse driven interface
giving you the code for each color. I find it very handy as each TV displays colors slightly
differently.
Rayman has put a web page with a screen capture for it at
http://www.rayslogic.com/propeller/Programming/TV_Colors.htm
and he also explains a bit how the color scheme works.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
Jo
cheers,
Mark
http://forums.parallax.com/showthread.php?p=649540
Change the "mouse" object to "pc_mouse" and start PropTerminal, then the mouse of the PC can be used like a PS2 mouse.
(Copy the "pc_mouse.spin", "pc_text.spin", "pc_interface.spin" and "pc_keyboard.spin" to the library folder first).
Andy
BTW, I love your sombrero!
Mark