Buscar pacotes, repositórios e categorias de apps

Repositório GitHubmunificent/malison

malison

Um pequeno pacote de emulação de terminal para Dart.

Capa do projeto malison
Estrelas
79
Forks
9
Último push (UTC)
18 de nov. de 2025
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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();
}

Example

The repo includes a little example web application so you can see it in action. From the root of repo, run:

$ dart run build_runner serve

Then in your browser of choice, navigate to http://localhost:8080.

Bob Nystrom GitHub avatar
Autor no GitHub

Bob Nystrom ↗

Programming language developer, ex-game developer, UI nerd, author of "Game Programming Patterns" and "Crafting Interpreters".

@google, on @dart-lang Seattle, WASite oficial ↗
LinguagensDartHTML

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 5 itens

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗