Games::Roguelike::Console - Platform-neutral console handling
use Games::Roguelike::Console; $con = Games::Roguelike::Console->new(); $con->attron('bold yellow'); $con->addstr('test'); $con->attroff(); $con->refresh();
Attempts to figure out which Games::Roguelike::Console subclass to instantiate in order to provide console support.
Create a new console, optionally specifying the subtype (win32, ansi, curses or dump:file[:keys]), and the noinit flag (which suppresses terminal initialization.)
If a type is not specified, a suitable default will be chosen.
Prints a string at the y, x positions or at the current cursor position (also positions the cursor at y, x+length(str))
Turns on color attributes ie: bold blue, white, white on black, black on bold blue
Turns off color attributes
Draws the current screen
Redraws entire screen (if out of sync)
Moves the cursor to y, x
Reads a character from input
Reads a character from input, non-blocking
Helper function for subclass, parses an attribute then calls "nativecolor($fg, $bg, $bold)", caching the results.
Subclass can define this instead of nativecolor, if desired.
Moves the cursor to y, x and writes the string $str, which can contain <color> tags
Changes the state of whether the cursor is shown, or returns the current state.
Sets the left margin (x) for things that parse out carraige returns, and is the rectangle used for scrolling.
Games::Roguelike::Console::ANSI, Games::Roguelike::Console::Win32, Games::Roguelike::Console::Curses
Erik Aronesty earonesty@cpan.org
earonesty@cpan.org
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html or the included LICENSE file.
To install Games::Roguelike::Mob, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Roguelike::Mob
CPAN shell
perl -MCPAN -e shell install Games::Roguelike::Mob
For more information on module installation, please visit the detailed CPAN module installation guide.