rust_pixel  by zipxing

Cross-platform 2D engine for retro and modern applications

Created 1 year ago
280 stars

Top 92.8% on SourcePulse

GitHubView on GitHub
Project Summary

A 2D game engine designed for retro aesthetics and cross-platform compatibility, rust_pixel enables developers to write games and applications once and run them on terminals, desktops, and the web. It offers a high-performance, tile-first rendering pipeline and a unified abstraction layer, making it suitable for both experienced developers and beginners looking for a straightforward entry into 2D game development.

How It Works

The engine employs a "tile-first" philosophy, organizing scenes hierarchically from Scene > Layer > Sprite > Buffer > Cell. Its core architectural choice is a unified rendering abstraction that achieves high performance by utilizing a single texture and a single draw call. This approach, combined with a Model-Render-Game pattern and an event-driven system, facilitates the "Write Once, Run Anywhere" goal, allowing a single codebase to target native GPU windows (even for TUIs), traditional terminals, and web browsers.

Quick Start & Requirements

  • Primary install: cargo install rust_pixel installs the cargo-pixel CLI. Running cargo pixel clones the workspace to ~/rust_pixel_work.
  • Prerequisites: Rust 1.71+ is the minimum supported version (MSRV). A Nerd Font is required for terminal mode, and wasm-pack is needed for web builds.
  • Links:

Highlighted Details

  • Cross-Platform TUI: Renders terminal UIs directly in native GPU windows, independent of terminal emulators, with features like GPU-accelerated transitions and text animations.
  • Built-in BASIC Interpreter: pixel_basic allows game logic to be written in familiar BASIC syntax, ideal for beginners or rapid prototyping.
  • Unified Texture Architecture: Employs a single 4096x4096 texture for all assets (sprites, TUI, emoji, CJK), minimizing draw calls and VRAM usage.
  • Rich Feature Set: Includes MSDF font rendering, PETSCII/SSF image support, code highlighting for 100+ languages, and various chart and layout capabilities demonstrated by the MDPT presentation toolkit.

Maintenance & Community

The README does not detail specific contributors, sponsorships, or community channels like Discord or Slack. A roadmap for 2026 is linked (doc/roadmap_2026.md).

Licensing & Compatibility

The project is licensed under the Apache 2.0 license. This license is permissive and generally compatible with commercial use and linking in closed-source projects.

Limitations & Caveats

Terminal mode requires a Nerd Font for proper display. Web builds necessitate the wasm-pack tool. The minimum supported Rust version is 1.71. While the engine aims for broad cross-platform consistency, specific platform nuances or performance characteristics may vary.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
13 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.