Skip to main content

Crate chill_bevy_console

Crate chill_bevy_console 

Source
Expand description

A configurable developer console plugin for Bevy games.

Press ` (backtick) to toggle the console open and closed. Commands are plain Bevy systems that take CommandArgs and return a String.

§Quickstart

use bevy::prelude::*;
use chill_bevy_console::{ChillConsole, CommandArgs, ConsoleAppExt, console_closed};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(ChillConsole::default())
        .add_console_command("say", "say <text> — echo text", say_cmd)
        .add_systems(Update, gameplay_input.run_if(console_closed))
        .run();
}

fn say_cmd(In(args): CommandArgs) -> String {
    args.join(" ")
}

fn gameplay_input() { /* movement, jump, etc. */ }

§Cargo features

  • embedded-font — embed UbuntuMono-R.ttf in the binary and use it as the default font, so consumers don’t need to ship a font asset.
  • persistent-history — load and save the console’s full display history (commands and their outputs) to a plain-text file between runs. The path is configured via ConsoleConfig::history_file.

§Customization

Every visual element is configurable via ConsoleConfig, with built-in presets (ConsoleConfig::chillgames, ConsoleConfig::matrix, ConsoleConfig::source) as starting points. See the USAGE.md guide and the examples/ directory for runnable demos.

Re-exports§

pub use config::ConsoleConfig;

Modules§

config

Structs§

Args
Parsed arguments passed to a console command system.
ChillConsole
The main plugin.
ConsoleRegistry
Registry of all commands available in the console.
ConsoleState

Constants§

UBUNTU_MONO_FONT_HANDLE
Stable handle for the embedded UbuntuMono font. Only meaningful when the embedded-font feature is enabled.

Traits§

ConsoleAppExt

Functions§

console_closed
Returns true when the console is closed.

Type Aliases§

CommandArgs
The input type for console command systems.