doonv / bevy_dev_console

Source-inspired developer console plugin for the Bevy game engine.
Apache License 2.0
112 stars 10 forks source link
bevy console developer-console rust source

bevy_dev_console

bevy_dev_console is a Source-inspired developer console plugin for the Bevy Game Engine.

Image of the developer console

[!WARNING]

bevy_dev_console is currently in its early development stages. Expect breaking changes in the near future (especially when using the built-in command parser). For this reason its only available as a git package at the moment.

Features

Usage

  1. Add the bevy_dev_console git package.

    cargo add --git https://github.com/doonv/bevy_dev_console.git
  2. Import the prelude.

    use bevy_dev_console::prelude::*;
  3. Add the plugins.

    use bevy::{prelude::*, log::LogPlugin};
    use bevy_dev_console::prelude::*;
    
    App::new()
        .add_plugins((
            // Add the log plugin with the custom log layer
            DefaultPlugins.set(LogPlugin {
                custom_layer: custom_log_layer,
                ..default()
            }),
            // Add the dev console plugin itself.
            DevConsolePlugin,
        ))
        .run();
  4. That should be it! You can now press the ` / ~ key on your keyboard and it should open the console!

Togglable Features

(default) builtin-parser includes the default parser. Disabling this allows you to remove the built-in parser and replace it with your own (or you could do nothing and make the console into a log reader).

Bevy Compatibility

bevy bevy_dev_console
0.14.* git (master)