Description

D port of rlutil.h - A simple utility library for coloring the console

Package Information

Version1.0.0 (2015-Jul-02)
Repository https://github.com/danyalzia/drlutil
LicenseBoost License
CopyrightCopyright © 2014, Danyal Zia
AuthorsDanyal Zia
Registered byDanyal Zia
Dependencies none

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

drlutil.d - D port of rlutil.h

Details

It is the D port of rlutil.h for changing the console text color, getting keyboard input, etc. It is designed to aid the creation of cross-platform console-mode roguelike games with D programming language.

Installation

Clone the repository:

$ git clone git://github.com/danyalzia/Drlutil

Once cloned, while in the Drlutil directory:

$ dub build

Usage

import std.stdio;
import rlutil.d;

void main() {
    setColor(YELLOW);
    writeln("This is Yellow Text");
 
    setColor(RED);
    writeln("This is Red Text");
 
    setColor(BLUE);
    writeln("This is Blue Text");
 
    setColor(GREEN);
    writeln("This is Green Text");
 
    setColor(WHITE);
    writeln("This is White Text");
 
    setColor(GREEN);
    write("Green, ");
    setColor(RED);
    write("Red, ");
    setColor(BLUE);
    writeln("Blue");
 
    // Change the color back to default grey
    setColor(GREY);
}

License

It is released under Boost license.

Available versions

1.0.0 ~master