Expand description
A plugin for making interactive Bevy applications with a TUI instead of a graphical interface.
§Examples
use bevy::prelude::*;
use bevy_tui::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
initialize_terminal()?;
App::new()
.add_plugins(MinimalTuiPlugins)
.run();
teardown_terminal()?;
Ok(())
}
Modules§
- prelude
- A quick helper module to allow including all the commonly used and exposed public portions of this library. It can be used in your project like so:
Structs§
- Minimal
TuiPlugins - A helper plugin group that sets up the bare minimum plugins for use in a Bevy plugin project.
This should be used in place of the Bevy
MinimalPlugins
plugin group as that includes a conflictingInputPlugin
. - RawConsole
Event - A published version of the raw Crossterm events received. This is one of the reasons why this
library is currently tied to this particular TUI backend for now. If you’re going to be using
text input in your UI, these events are likely what you want over the
Input<KeyCode>
events as letter casing and non-US/ASCII keyboard characters are preserved. - Terminal
- The Bevy resource that gets exposed to perform frame render operations. This is a thin wrapper
around a
ratatui::Terminal
with no specific backend specified. - TuiPlugin
- A Bevy Plugin that includes a dedicated scheduler based on a maximum frame duration and the
various events provided to the application from the terminal itself. This should not be used
with the standard Bevy
InputPlugin
, the stockScheduleRunnerPlugin
, or any of the Winit plugins as they implement and operate on several of the same events as this.
Type Aliases§
- Bevy
Terminal - A short-hand type for a crossterm backed TUI terminal connected to STDOUT. This will likely go away in a more finalized version.