-
Input Preservation
I'm writing a real-time text adventure. However, there is one problem that never ceases to annoy me: the fact that whenever output is printed, it overwrites the line with the user's input.
Does anyone know how to keep the bottom line untouched and reserved for input? Or at least make it appear to be one of those?
-
What you need to do if you want a "split screen" is to write your own scroll routines to move the text within each section of the screen separately. You may be able to do that in a way that just uses the standard Windows or ncurses API - not sure, but the concept is pretty straight forward: copy the text up one line and reprint. Are you working on Windows or Linux (or something else)?
--
Mats
-
I'm using Mac OS X Leopard, but writing in C for maximum cross-compatibility.
-
Ok, so you probably want to look into using ncurses then, as that's the library for Linux/Unix/MacOS development. There's a PDCurses for Windows that I've heard good things about too. I'm not sure how you tell ncurses to "delete one line at the top, insert one at line Y" (where Y is less than the whole height of the terminal window).
--
Mats
-
Thanks for the help. I'll look into it.