Crates.io | bevy_terminal_display |
lib.rs | bevy_terminal_display |
version | 0.4.3 |
source | src |
created_at | 2024-07-24 16:05:54.547541 |
updated_at | 2024-08-24 00:45:50.379513 |
description | A plugin for the Bevy game engine which enables rendering to a terminal using unicode braille characters. |
homepage | |
repository | https://github.com/exvacuum/bevy_terminal_display |
max_upload_size | |
id | 1314125 |
size | 85,885 |
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:
TerminalDisplayBundle
automatically sets up a correctly-formatted render textureTerminalInput
resource which keeps track of pressed & released keysWidget
component for rendering ratatui TUI widgetsTerminalWidget
trait for creating custom TUI widget componentsCrate Version | Bevy Version |
---|---|
0.3-0.4 | 0.14 |
0.2 | 0.13 |
[dependencies]
bevy_terminal_display = "0.3"
[dependencies.bevy_terminal_display]
git = "https://github.com/exvacuum/bevy_terminal_display.git"
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(),
))
.insert_resource(Msaa::Off) // For post-process
.run();
}
When spawning a camera:
let terminal_display_bundle = bevy_terminal_display::display::components::TerminalDisplayBundle::new(3, &asset_server);
commands.spawn((
Camera3dBundle {
camera: Camera {
target: terminal_display_bundle.image_handle().into(),
..Default::default()
},
..Default::default()
},
terminal_display_bundle,
));
This crate is licensed under your choice of 0BSD, Apache-2.0, or MIT license.