Rand Stats

Terminal::Caca

github:azawawi

Terminal::Caca

Actions
Status

Terminal::Caca - Use libcaca (Colour AsCii Art library) API in Raku

NOTE: The library is currently experimental. You have been warned :)

Normally you would use the safer object-oriented API via Terminal::Caca. If you need to access raw API for any reason, please use Terminal::Caca::Raw.

Example

use v6;
use Terminal::Caca;

# Initialize library
given my $o = Terminal::Caca.new {
    # Set window title
    .title("Raku rocks");

    # Say hello world
    my $text = ' Hello world, from Raku! ';
    .color(white, blue);
    .text(10, 10, $text);

    # Draw an ASCII-art box around it
    .thin-box(9, 9, $text.chars + 2, 3);

    # Refresh display
    .refresh;

    # Wait for a key press event
    .wait-for-keypress;

    # Cleanup on scope exit
    LEAVE {
        .cleanup;
    }
}

For more examples, please see the examples folder.

Installation

$ sudo apt-get install libcaca-dev
$ brew update
$ brew install libcaca
$ zef install Terminal::Caca

Testing

$ prove --ext .rakutest -ve "raku -I."
$ zef install Test::META
$ AUTHOR_TESTING=1 prove --ext .rakutest -ve "raku -I."

Author

Ahmad M. Zawawi, azawawi on #raku, https://github.com/azawawi/

License

MIT