#widgets #terminal #component #texture #resize #key #redirect #io #bevy-terminal-display

bevy_terminal_display

A plugin for the Bevy game engine which enables rendering to a terminal using unicode braille characters

8 releases (4 breaking)

new 0.7.0 Apr 2, 2025
0.6.0 Dec 20, 2024
0.5.0 Dec 11, 2024
0.4.3 Aug 24, 2024
0.3.0 Jul 24, 2024

#513 in Game dev

Download history 113/week @ 2024-12-16 7/week @ 2024-12-23 1/week @ 2025-01-06 1/week @ 2025-02-03 4/week @ 2025-02-10 8/week @ 2025-02-17 2/week @ 2025-02-24 6/week @ 2025-03-03 1/week @ 2025-03-10 124/week @ 2025-03-31

125 downloads per month

0BSD OR MIT OR Apache-2.0

87KB
715 lines

bevy_terminal_display

Crates License

A (very experimental) plugin for the Bevy engine which allows for rendering to a terminal window.

WARNING: I highly recommend using the kitty terminal emulator with this, not only due to the gpu-accelerated rendering, but also the implementation of the kitty protocol which enables the advanced input detection.

Features Include:

  • TerminalDisplay automatically sets up a correctly-formatted render texture
  • Post-process dithers colors to pure black and white, which are then printed as braille characters to the terminal
  • Responsiveness to terminal window resizing
  • TerminalInput resource which keeps track of pressed & released keys
  • Widget component for rendering ratatui TUI widgets
  • TerminalWidget trait for creating custom TUI widget components
  • Log redirection

Screenshots

Compatibility

Crate Version Bevy Version
0.6-0.7 0.15
0.4 0.14
0.2 0.13

Installation

crates.io

[dependencies]
bevy_terminal_display = "0.7"

Using git URL in Cargo.toml

[dependencies.bevy_terminal_display]
git = "https://git.soaos.dev/soaos/bevy_terminal_display"

Example Usage

In main.rs:

use bevy::prelude::*;
use bevy_terminal_display;

fn main() {
    App::new()
        .add_plugins((
            DefaultPlugins.build().disable::<WinitPlugin>().disable::<LogPlugin>,
            ScheduleRunnerPlugin::run_loop(Duration::from_secs_f32(1.0 / 60.0)),
            bevy_terminal_display::TerminalDisplayPlugin::default(),
        ))
        .run();
}

When spawning a camera:

commands.spawn((
    // Camera3d...
    TerminalDisplay(3), // Field is level of dithering
));

License

This crate is licensed under your choice of 0BSD, Apache-2.0, or MIT license.

Dependencies

~69–105MB
~2M SLoC