rlutil.rlutil

D port of rlutil.h https://github.com/tapio/rlutil

About: Description This file provides some useful utilities for console mode roguelike game development with C and C++. It is aimed to be cross-platform (at least Windows and Linux).

Members

Aliases

RLUTIL_STRING_T
alias RLUTIL_STRING_T = string
Undocumented in source.

Enums

BLACK
anonymousenum BLACK

Enums: Color codes

Functions

anykey
void anykey()

// Function: trows // Get the number of rows in the terminal window or -1 on error. / return csbi.dwSize.Y; // Buffer height // Function: tcols // Get the number of columns in the terminal window or -1 on error. / return csbi.dwSize.X; // Buffer width Function: anykey Waits until a key is pressed.

cls
void cls()
Undocumented in source. Be warned that the author may not have intended to support it.
getANSIColor
RLUTIL_STRING_T getANSIColor(const(int) c)

Function: getANSIColor Return ANSI color escape sequence for specified number 0-15.

getch
int getch()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
getch
int getch()

Function: getch Get character without waiting for Return to be pressed. Windows has this in conio.h

getkey
int getkey()

Function: getkey Reads a key press (blocking) and returns a key code.

gotoxy
void gotoxy(int x, int y)

Function: gotoxy Same as <rlutil.locate>.

hidecursor
void hidecursor()

Function: hidecursor Hides the cursor.

kbhit
int kbhit()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
kbhit
int kbhit()

Function: kbhit Determines if keyboard has been hit. Windows has this in conio.h

locate
void locate(int x, int y)

Function: locate Sets the cursor position to 1-based x,y.

msleep
void msleep(uint ms)

Function: msleep Waits given number of milliseconds before continuing.

nb_getch
int nb_getch()

Function: nb_getch Non-blocking getch(). Returns 0 if no key was pressed.

setColor
void setColor(int c)

Function: setColor Change color specified by number (Windows / QBasic colors).

showcursor
void showcursor()

Function: showcursor Shows the cursor.

Manifest constants

Linux
enum Linux;
Undocumented in source.
Linux
enum Linux;
Undocumented in source.
RLUTIL_USE_ANSI
enum RLUTIL_USE_ANSI;

Define: RLUTIL_USE_ANSI Define this to use ANSI escape sequences also on Windows (defaults to using WinAPI instead).

Windows
enum Windows;
Undocumented in source.
Windows
enum Windows;
Undocumented in source.

Variables

ANSI_BLACK
RLUTIL_STRING_T ANSI_BLACK;
Undocumented in source.
ANSI_BLUE
RLUTIL_STRING_T ANSI_BLUE;
Undocumented in source.
ANSI_BROWN
RLUTIL_STRING_T ANSI_BROWN;
Undocumented in source.
ANSI_CLS
RLUTIL_STRING_T ANSI_CLS;

Consts: ANSI color strings

ANSI_CYAN
RLUTIL_STRING_T ANSI_CYAN;
Undocumented in source.
ANSI_DARKGREY
RLUTIL_STRING_T ANSI_DARKGREY;
Undocumented in source.
ANSI_GREEN
RLUTIL_STRING_T ANSI_GREEN;
Undocumented in source.
ANSI_GREY
RLUTIL_STRING_T ANSI_GREY;
Undocumented in source.
ANSI_LIGHTBLUE
RLUTIL_STRING_T ANSI_LIGHTBLUE;
Undocumented in source.
ANSI_LIGHTCYAN
RLUTIL_STRING_T ANSI_LIGHTCYAN;
Undocumented in source.
ANSI_LIGHTGREEN
RLUTIL_STRING_T ANSI_LIGHTGREEN;
Undocumented in source.
ANSI_LIGHTMAGENTA
RLUTIL_STRING_T ANSI_LIGHTMAGENTA;
Undocumented in source.
ANSI_LIGHTRED
RLUTIL_STRING_T ANSI_LIGHTRED;
Undocumented in source.
ANSI_MAGENTA
RLUTIL_STRING_T ANSI_MAGENTA;
Undocumented in source.
ANSI_RED
RLUTIL_STRING_T ANSI_RED;
Undocumented in source.
ANSI_WHITE
RLUTIL_STRING_T ANSI_WHITE;
Undocumented in source.
ANSI_YELLOW
RLUTIL_STRING_T ANSI_YELLOW;
Undocumented in source.
KEY_DELETE
int KEY_DELETE;
Undocumented in source.
KEY_DOWN
int KEY_DOWN;
Undocumented in source.
KEY_END
int KEY_END;
Undocumented in source.
KEY_ENTER
int KEY_ENTER;
Undocumented in source.
KEY_ESCAPE
int KEY_ESCAPE;

Consts: Key codes for keyhit()

KEY_F1
int KEY_F1;
Undocumented in source.
KEY_F10
int KEY_F10;
Undocumented in source.
KEY_F11
int KEY_F11;
Undocumented in source.
KEY_F12
int KEY_F12;
Undocumented in source.
KEY_F2
int KEY_F2;
Undocumented in source.
KEY_F3
int KEY_F3;
Undocumented in source.
KEY_F4
int KEY_F4;
Undocumented in source.
KEY_F5
int KEY_F5;
Undocumented in source.
KEY_F6
int KEY_F6;
Undocumented in source.
KEY_F7
int KEY_F7;
Undocumented in source.
KEY_F8
int KEY_F8;
Undocumented in source.
KEY_F9
int KEY_F9;
Undocumented in source.
KEY_HOME
int KEY_HOME;
Undocumented in source.
KEY_INSERT
int KEY_INSERT;
Undocumented in source.
KEY_LEFT
int KEY_LEFT;
Undocumented in source.
KEY_NUMDEL
int KEY_NUMDEL;
Undocumented in source.
KEY_NUMPAD0
int KEY_NUMPAD0;
Undocumented in source.
KEY_NUMPAD1
int KEY_NUMPAD1;
Undocumented in source.
KEY_NUMPAD2
int KEY_NUMPAD2;
Undocumented in source.
KEY_NUMPAD3
int KEY_NUMPAD3;
Undocumented in source.
KEY_NUMPAD4
int KEY_NUMPAD4;
Undocumented in source.
KEY_NUMPAD5
int KEY_NUMPAD5;
Undocumented in source.
KEY_NUMPAD6
int KEY_NUMPAD6;
Undocumented in source.
KEY_NUMPAD7
int KEY_NUMPAD7;
Undocumented in source.
KEY_NUMPAD8
int KEY_NUMPAD8;
Undocumented in source.
KEY_NUMPAD9
int KEY_NUMPAD9;
Undocumented in source.
KEY_PGDOWN
int KEY_PGDOWN;
Undocumented in source.
KEY_PGUP
int KEY_PGUP;
Undocumented in source.
KEY_RIGHT
int KEY_RIGHT;
Undocumented in source.
KEY_SPACE
int KEY_SPACE;
Undocumented in source.
KEY_UP
int KEY_UP;
Undocumented in source.

Meta

Authors

<a href="http://github.com/danyalzia">Danyal Zia</a>