Inverting Text in TI-92 BASIC
By: Anonymous
This article explains "a cool programmingtrick for the TI-92 Basic" that allows you to invert the text.

This is really nothing but a cool programming trick for TI-92 Basic. You can display inverted text easily by using two pictures. The other routine is to display a flashing inverted text which is a little more trickier.

Starting with the inverted text, you will need to make two pictures in your program (It would be best if you created these pics at the beginning at your game to avoid any disturbance from the game). You need put your text on the screen and store it as a picture. Be sure and get the exact lengths of the text so this will work. Then create a black box the same size as the text or whatever fits your needs. After you have created the pics, use this code to make the text inverted:

PxlText "My Text",5,5
StoPic titlepic,5,5,100,10
ClrDraw
For a,102,89,-1
LineHorz a
EndFor
StoPic blkbar,0,0,238,89

...

RclPic blkbar,0,0
XorPic titlepic,3,3

This routine first creates the text you are going to display inverted, you must do this. Then it creates a black bar, which extends across the screen (it can be whatever width you want, but it must be at least as big as the text). When you want to use it later in the program, you use the code after the three dots. The first recalls the black bar picture, and the second inverts the text using the logic command XOR. XOR works like this:

true  xor false = true

false xor false = false

true  xor true  = false

So when the letters of the text are XORed with the black pic, it turns the pixels off, thereby creating inverted text!

--------------------------------------------------------------------------------

Another routine is for flashing inverted text, like "GAME OVER" flashing at you when you die or something. This is a little more complicated to explain, so I hope I do my best at explaining it.

PxlText "GAME OVER",1,1
StoPic gameovr1,0,0,57,10
ClrDraw
For a,102,93,-1
Line 0,a,56,a
EndFor
StoPic gameovr3,0,0,57,10
XorPic gameovr1,0,0
StoPic gameovr2,0,0,57,10
XorPic gameovr3,0,0
Lbl loopit
XorPic gameovr3,0,0
For a,1,15:EndFor
XorPic gameovr3,0,0
For a,1,15:EndFor
Goto loopit

First the program makes a picture of the text. Then it draws a black box right over it, covering it up, and it is one more pixel around the text, mainly for effect. It stores that picture, then uses the text pic to make and inverted text pic, using the routine at the top of this article. The loop then starts, first by display the regular text by inverted the 'inverted' text back to the original, black on white. It then inverts the text using the black bar pic and re-inverts it again using the same pic. This can continue on and on unless you put something in there that will make it stop.

I hope you understand this enough, but in case you don't, you can email me at . Enjoy!