Expand description

License: MIT Crates.io docs

Bevy Ascii Terminal

A simple ascii terminal integrated into bevy’s ecs framework.


The goal of this crate is to provide a simple, straightforward, and hopefully fast method for rendering colorful ascii in bevy. It was made with “traditional roguelikes” in mind, but should serve as a simple UI tool if needed.

Example

use bevy::prelude::*;
use bevy_ascii_terminal::*;

fn setup(mut commands: Commands) {
    // Create the terminal
    let mut terminal = Terminal::new([20,3]).with_border(Border::single_line());
    // Draw a blue "Hello world!" to the terminal
    terminal.put_string([1, 1], "Hello world!".fg(Color::BLUE));

     
    commands.spawn((
        // Spawn the terminal bundle from our terminal
        TerminalBundle::from(terminal),
        // Automatically set up the camera to render the terminal
        AutoCamera
    ));
}

fn main () {
    App::new()
    .add_plugins(DefaultPlugins)
    .add_plugin(TerminalPlugin)
    .add_startup_system(setup)
    .run();
}

Versions

bevybevy_ascii_terminal
0.90.12.1
0.8.10.11.1
0.80.11
0.70.9-0.10

Re-exports

pub use prelude::*;

Modules

Utilities for translating between glyphs and Code Page 437 indices.

Structs

This component can be added to terminal entities as a simple way to have have the camera render the terminals. The camera viewport will automatically be resized to show all terminal entities with this component.
Layout settings for the terminal renderer.
Plugin for terminal rendering and related components and systems.
A camera with a virtual grid for displaying low resolution pixel art.
Component bundle with functions to specify how you want the camera set up.
A component for converting positions between World Space and “Terminal Space”.

Enums

A pivot point on a 2d rect.
Helper component for changing the terminal’s font

Constants

The primary terminal rendering function labels System label for the terminal font changing function.
The primary terminal rendering function labels System label for the terminal mesh initialization system.
The primary terminal rendering function labels System label for the terminal mesh size update function.
The primary terminal rendering function labels System label for the terminal layout update system.
The primary terminal rendering function labels System label for the terminal material change system.
The primary terminal rendering function labels System label for the terminal render system. This is the last terminal system to run and runs at the end of the frame.
The primary terminal rendering function labels

Traits

A trait for types representing an integer point on a 2d grid.
A trait for types representing a 2d size.