Thread: Extremely simple GUI

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    42

    Extremely simple GUI

    I'm looking for something that will allow me to create a simple text adventure game with ascii art. What sort of software layer (or whatever you call it) can I use to do this? i.e. just a text GUI, if that makes any sense.

  2. #2
    Registered User TheBigH's Avatar
    Join Date
    May 2010
    Location
    Melbourne, Australia
    Posts
    426
    Check out ncurses.
    Code:
    while(!asleep) {
       sheep++;
    }

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    505
    Quote Originally Posted by Paul Omans View Post
    I'm looking for something that will allow me to create a simple text adventure game with ascii art. What sort of software layer (or whatever you call it) can I use to do this? i.e. just a text GUI, if that makes any sense.
    Abstract it. Basically write the function charat(int x, int y, int ch), and implement everything else on top of that. So if you want a box of asterisks, the box drawing function calls charat().

    There are some things to consider for charat(). You need to know if you define the width and height of the text area, or you accept what's given to you. You also need to know if you need a synch/flush function to call every frame. (On some platforms this could be completely empty, because the system manages the raster for you).
    You also need to consider if you need a initscreen(), closescreen() pair to set up and tear down the system.
    I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
    Visit my website for lots of associated C programming resources.
    https://github.com/MalcolmMcLean


  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    BigH nailed it, in his post, above.. You will be creating your program on the text console window, and you will DEFINITELY want a program like curses, or ncurses, (those are slightly different siblings of each other), or conio.h.

    Using a console control program, like curses, it's easy to create a rich text based adventure game area, on-screen. You control the location, the basic shapes you want, the color, and in some cases, even the texture, of the ascii char you're printing. There are many design char's in the "extended" ascii range, (which is everything from 127 to 255).

    If you don't have an ascii chart with the extended chars, you should

    ░░░░░░ Download One ░░░░░░
    Last edited by Adak; 06-20-2013 at 09:10 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. extremely confused
    By hockey1 in forum C Programming
    Replies: 9
    Last Post: 04-24-2009, 11:36 AM
  2. something extremely wierd
    By nerdykid in forum C++ Programming
    Replies: 3
    Last Post: 11-04-2007, 10:14 AM
  3. extremely simple help
    By C++idiot in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2007, 10:39 AM
  4. output to file (extremely simple but...)
    By kantze in forum C++ Programming
    Replies: 6
    Last Post: 04-12-2007, 03:24 PM
  5. Extremely Simple Graphics In Dos
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-07-2002, 07:25 PM