malison 0.10.1+1

Malison is a small Dart library for drawing old school ASCII terminals in
the browser. I harvested it from my roguelike game, Hauberk and it's aimed
primarily at web games ASCII graphics. Think of it like curses for the web.

Using it

Add it to your package's pubspec:

dependencies:
malison: any

Then use the library:

import 'dart:html';
import 'package:malison/malison.dart';
void main() {
// Create or query a <canvas> element to bind it to.
var canvas = new CanvasElement();
document.body.children.add(canvas);
// Create a new terminal. CanvasTerminal uses your browser's fonts.
// RetroTerminal uses a built in DOS-style Code Page 437 font.
var terminal = new RetroTerminal.dos(80, 40, canvas);
// You can draw strings at given positions.
terminal.writeAt(0, 0, "This is a terminal!");
// You can control the foreground and background color.
terminal.writeAt(0, 1, "This is blue on green", Color.blue, Color.green);
// You can also draw individual glyphs -- character+color units.
terminal.drawGlyph(3, 4, new Glyph.fromCharCode(CharCode.blackHeartSuit,
Color.red, Color.white));
// When you're done drawing, tell it to render all of the changes. It renders
// in batches for performance.
terminal.render();
}

0.10.0

Update to Dart 2. Remove new and const keywords.

0.9.0

keyUp() events.

0.8.0

Change Color.blend() to take a value from (0, 1.0) instead of a percent.

Add Color.add().

0.7.0

Fill in the rest of the character codes to CharCode.

Add Color.blend() and store colors as RGB.

Add foreColor, backColor, and fill() to Terminal.

0.6.0

Split into two libraries. The core malison library does not import "dart:html"
and can be used in command-line applications. It's not useful outside of
the web, but it lets you test code in a "headless" fashion that uses malison
on the standalone VM.

0.5.1

Get rid of implicit casts and dynamic.

0.5.0

Add type parameters to UserInterface, KeyBindings, and
Screen so that the bound objects can be precisely typed.

0.4.3

Make strong mode clean.

0.4.2

Widen constraint on piecemeal.

0.4.1

Fix semicolon handling on Firefox.

0.4.0

Add constants to CharCode for every character in code page 437.

Make constants lowerCamelCase.

0.3.0

Automatically create a canvas if not given one.

Allow creating a UserInterface without an initial terminal.

Add an example app.

0.2.1

Fix bad assert in Screen._bind().

0.2.0

Redo key input handling. Instead of a (mostly broken) Keyboard class, it
exposes raw key down events as they happen and also allows user-defined
key bindings.

Refactor UserInterface and clean up how opaque/transparent screens are
handled.