4 releases
0.1.3 | Feb 19, 2024 |
---|---|
0.1.2 | Nov 29, 2023 |
0.1.1 | Nov 28, 2023 |
0.1.0 | Nov 28, 2023 |
#735 in Game dev
53 downloads per month
30KB
523 lines
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
Dependencies
~38–76MB
~1.5M SLoC