Shop OBEX P1 Docs P2 Docs Learn Events
printing last position in vga_text.spin — Parallax Forums

printing last position in vga_text.spin

Richard S.Richard S. Posts: 70
edited 2007-02-23 05:00 in Propeller 1
In the current configuration, I understand vga_text.spin to have 0-14 lines of 0-31 characters per line.· I am unable to print to the 14th line, character position 31 without causing display problems...such as·scrolling some of the top lines off of the display pane.· How can I get around this?· In order to print to position 0 on a given line, I have to set x position as 1 then backspace once to start at 0 position.· Here is the line I wish to display...

· text.str(string($A,1,$08,$B,14,$C,7,$0E,$07,"·· 1-Main Menu· 2-Clear·· · ",$06,$0E))

Any thoughts would be appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-23 04:56
    The only way you'd be able to print to the last column of the last line is to write your own little routine to do so. The interface routines furnished always check for the end of the line and wrap around. On the last line, they scroll the display as you've noticed. You've also noticed that the "string()" function doesn't allow zero bytes in the string. This is because text.str uses a zero byte value to mark the end of the string.

    To position to column zero, use two statements: "text.out($A)" followed by "text.out(0)"

    To store a single character to any position on the screen without advancing the cursor, add the following to your vga_text.spin before the DAT section:
    PUB storeChar(col,row,c)
    
      screen[noparse][[/noparse]row * cols + col] := (color << 1 + c & 1) << 10 + $200 + c & $FE
    
    


    To store "x" at row 14, column 31, you'd call "text.storeChar(31,14,"x").
  • Richard S.Richard S. Posts: 70
    edited 2007-02-23 05:00
    Thanx Mike...I will give it a try.

    Best Regards...
Sign In or Register to comment.