Thread: Text positioning and Text scrolling

  1. #1
    1479
    Join Date
    Aug 2003
    Posts
    253

    Text positioning and Text scrolling

    I have read adrainx's amazing site about how consoles work and how to manipulate them. What I am wanting to do is sort of complicated to explain.
    Code:
    ___________________________________
    |                                 |
    |                                 | 
    |                                 |
    |                                 | 
    |                                 | 
    |  Text scrolls here              |                  
    |                                 |
    |                                 |
    |                                 |
    | ________________________________| 
    |                                 |
    | Menu that doesn't scroll and is |
    | always displayed                |
    |                                  |
    |__________________________________|
    Now where it says "Text scrolls here"...this is where I want everything that happens to be output to. If it pages of words or whatever I do not want it to go past the line and run into the box that says "Menu......" . I want the box that displays the menu to never go away and always be viewed.

    Does anyone know how or where I can get the code or ideas of how to get the code? Also, on adrianx's site, I was wondering where he got all that information from. In a few of his tutorials he mentions MSDN. I went there and couldn't decifer what any of it meant.

    Edit: I already know how to put text where I want it, I just don't know how to confine it to a certain spot on the grid. I also am thinking about how I would let the user scroll the text.?!?!?
    Last edited by RealityFusion; 08-12-2004 at 11:50 PM.
    Knowledge is power and I want it all

    -0RealityFusion0-

  2. #2
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    if you are using true console mode you'll have the problem that there is no guarantee there will be the same number of columns every time the console window is open.

  3. #3
    1479
    Join Date
    Aug 2003
    Posts
    253
    Even if I have the program open in full screen mode? I don't know of a way to prevent a person from manually changing the window size but I am not to concerned with that at the moment.
    Knowledge is power and I want it all

    -0RealityFusion0-

  4. #4
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    I am in no way certain of this but I would guess that in full screen mode the number of columns still depends on desktop resolution, and I'm not sure you can prevent the window size from being changed without getting into windows programming. The only way I can think to do what you want is to output your text strings into some sort of buffer, then print the right number of strings out, changing which numbers are printed when scrolling up or down.
    [pseudocode]
    char *[] strings;
    int columnstart;
    int column;
    int columncount; //number of columns in scroll portion of window

    for(column=columnstart;column<columncount;column++ )
    printf("%s",strings[column]);

    if(/*down key is pressed*/)
    columnstart++;
    if(/*up key is pressed*/)
    columnstart--;
    [/pseudocode]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  2. Positioning of Text under Graphical Environment
    By devarishi in forum C Programming
    Replies: 2
    Last Post: 03-17-2009, 02:15 PM
  3. help with positioning text on console
    By cdkiller in forum C++ Programming
    Replies: 2
    Last Post: 10-01-2006, 05:28 PM
  4. positioning text
    By abrege in forum C++ Programming
    Replies: 3
    Last Post: 11-18-2002, 10:15 PM