搜尋套件、儲存庫與 APP 分類

套件詳情v0.14.1

malison

一個用於瀏覽器的小型終端使用者介面套件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
521
喜歡數
11
Pub 分數
140

安裝套件

flutter pub add malison

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Malison 是一個輕量級的終端風格使用者介面套件,專為網路應用設計,讓開發者能夠直接在瀏覽器中建立復古風格的文字介面。此套件基於 Flutter 建構,支援互動式命令列體驗,非常適合需要終端美學的遊戲或工具。該套件可無縫整合至多個平台,包括行動裝置與桌面,使其在跨平台開發中極具彈性。它利用 Dart 的功能,有效率地呈現與管理類似終端機的輸出與輸入。

適用情境

  • 建立基於瀏覽器的文本冒險遊戲
  • 為網路應用程式建構終端模擬器
  • 開發互動式命令列工具
  • 模擬復古計算環境
  • 在Web應用程式中實現調試控制台

主要特色

  • 終端樣式使用者介面渲染
  • 跨平台相容性
  • 簡單命令輸入處理
  • 輕量且快速的性能
  • 支援 ANSI 轉義碼
  • 內建文字格式化和樣式

適合對象

  • 面向網路瀏覽器的遊戲開發者
  • 互動教育工具的創作者
  • CLI 類 Web 界面的建構者
  • 復古遊戲美學愛好者
  • 尋求最小化 UI 框架的開發人員

使用建議

  • 僅限終端樣式設計模式
  • 不適合複雜的圖形介面
  • 需要熟悉終端機/命令列概念
  • 最適合特定用途,而非一般使用者介面需求
  • 可能需要額外的邏輯來實現高級互動

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。