slowchop_console

Crates.ioslowchop_console
lib.rsslowchop_console
version0.1.3
sourcesrc
created_at2023-11-28 07:02:43.512611
updated_at2024-02-19 07:43:40.517801
descriptionA Quake style console and log plugin for Bevy.
homepage
repositoryhttps://github.com/slowchop/console
max_upload_size
id1051660
size111,338
gak (gak)

documentation

README

slowchop_console

A Quake style console and log plugin for Bevy.

⚠️ Warning ⚠️

This was rushed out for the Bevy Jam, and only tested on macOS. Not recommended to use, unless you're willing to help fix it up. 😅

Features

  • Uses bevy_ui for rendering.
  • A console that can be opened and closed with a keypress.
  • Captures all bevy (tracing) log messages and displays them in the console.
  • Colorizes log messages depending on log level.
  • Uses an enum as the possible actions. ("Commands" IMO is a better term but that's taken by Bevy.)
    • Enum supports floats, integers, strings, bools, and Vec of those types.
    • Optional arguments work, which must be after any non-optional arguments.
    • Actions are validated against the enum.
  • Actions executed are emitted as an event.

Actions Enum

use bevy::prelude::Event;
use slowchop_console::Actions;

#[derive(Actions, Event)]
enum MyGameActions {
   Quit,
   Spawn(f32, f32, f32, Option<String>),
}

This will create a quit action that takes no arguments. The spawn action takes 3 floats, and optionally a String.

Check out the full example on how to integrate.

License: MIT OR Apache-2.0

Commit count: 40

cargo fmt