• Stars
    star
    711
  • Rank 63,679 (Top 2 %)
  • Language
    Rust
  • License
    Other
  • Created almost 4 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

In-App editor tools for bevy applications

bevy_editor_pls

⚠️ This is very much work in progress: Take a look at the missing features to see if your use case isn't yet supported.

Adds debug tools to your bevy game, including

  • hierarchy view and component inspector
  • separate editor camera
  • some builtin editor panels for diagnostics, debug settings
  • scene export

This is not, and isn't meant to be, comparable to the actual editor bevy will end up with. bevy_editor_pls attempts to get the low hanging fruits by adding editor UI to the game executable, without having all the complexity that comes with having a proper well-designed editor architecture.

How to use:

Add the EditorPlugin:

+use bevy_editor_pls::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
+       .add_plugin(EditorPlugin::default())
        ...
        .run();
}

editor preview

Custom editor panels

use bevy_editor_pls::{egui, prelude::*};
use bevy_editor_pls_core::editor_window::{EditorWindow, EditorWindowContext};

fn main() {
    App::new()
        ...
        .add_editor_window::<MyEditorWindow>()
        ...
        .run();
}

pub struct MyEditorWindow;
struct MyEditorWindowState {
}
impl EditorWindow for MyEditorWindow {
    type State = MyEditorWindowState;
    const NAME: &'static str = "Another editor panel";

    fn ui(world: &mut World, cx: EditorWindowContext, ui: &mut egui::Ui) {
        let currently_inspected = &cx.state::<MyEditorWindow>().unwrap().selected;

        ui.label("Anything can go here");
    }
}

Controls

The default controls are:

  • E to toggle the editor
  • Ctrl+Enter to pause/unpause time
  • F to focus selected entity
  • T/R/S to show translate/rotate/scale gizmo
  • Double click on the menu bar to go fullscreen

Cameras:

  • 2d (Pan/Zoom): any mouse button to pan, scroll to zoom
  • 3d (Free): WASD + Ctrl/Shift + Shift for a speed boost for the free 3d camera
  • 3d (Pan/Orbit): Right click to rotate around focus, Middle mouse button to pan
Changing the default controls
use bevy_editor_pls::EditorPlugin;
use bevy_editor_pls::controls;
use bevy_editor_pls_default_windows::hierarchy::picking::EditorRayCastSource;

fn main() {
    App::new()
        // ..
        .add_plugin(EditorPlugin)
        .insert_resource(editor_controls())
        .add_startup_system(set_cam3d_controls)
        // ..
        .run();
}

fn editor_controls() -> EditorControls {
    let mut editor_controls = EditorControls::default_bindings();
    editor_controls.unbind(controls::Action::PlayPauseEditor);

    editor_controls.insert(
        controls::Action::PlayPauseEditor,
        controls::Binding {
            input: controls::UserInput::Single(controls::Button::Keyboard(KeyCode::Escape)),
            conditions: vec![controls::BindingCondition::ListeningForText(false)],
        },
    );

    editor_controls
}

fn set_cam3d_controls(
    mut query: Query<&mut bevy_editor_pls::default_windows::cameras::camera_3d_free::FlycamControls>,
) {
    let mut controls = query.single_mut();
    controls.key_up = KeyCode::Q;
    controls.key_down = KeyCode::E;
}

Missing features

  • scene import
  • visualization of invisible entities in editor (to see where the camera is for example)

Bevy support table

bevy bevy_editor_pls
0.10 0.4
0.10 0.3
0.9 0.2
0.8 0.1

More Repositories

1

bevy-inspector-egui

Inspector plugin for the bevy game engine
Rust
1,125
star
2

bevy_mod_debugdump

Rust
247
star
3

wasm-server-runner

cargo run for the browser
Rust
138
star
4

bevycheck

Rust
84
star
5

bevy_mod_js_scripting

Rust
80
star
6

piechart

a rust crate for drawing fancy pie charts in the terminal
Rust
38
star
7

rupnp

Rust library for the universal plug and play protocol.
Rust
35
star
8

cargo-watt

cargo subcommand for building proc-macro crates with web assembly
Rust
34
star
9

axum_openapi

Rust
31
star
10

sonor

Sonos library for rust
Rust
31
star
11

bevy-contrib-inspector

bevy plugin for starting a webserver to visually edit bevy resources
Rust
21
star
12

bevy_ecs_dynamic

Utilites for working with `bevy_ecs` when not all types are known at compile time
Rust
19
star
13

ssdp-client

An asynchronous Rust library for discovering, notifying and subscribing to devices and services on a network.
Rust
11
star
14

watt-contrib

Rust
8
star
15

ezoauth

Easy to use OAuth2 client for rust
Rust
7
star
16

deno-progressbar

a terminal progressbar for deno
TypeScript
5
star
17

pretty-type-name

Rust
4
star
18

bevy_reflect_ts_type_export

TypeScript
4
star
19

tts-urls

Generate URLs from TTS services, a rust crate
Rust
4
star
20

bevy-asset-distill

Rust
4
star
21

bevy-unofficial-playground-experiments

👀
Rust
4
star
22

Atlas

Render and visualize paths for Celeste TASes
Rust
3
star
23

bevy_shadertoy

Rust
2
star
24

bevy_reflect_fns

Experimentation for reflecting methods using bevy_reflect, to be upstreamed later
Rust
2
star
25

dotfiles

Shell
1
star
26

websocket-async-io

Rust
1
star
27

mc-mod-muffle

A minecraft mod for the fabric modloader which adds a Sound Muffler
Java
1
star
28

trout

TSP solver for routing celeste lobbies while TASing
Rust
1
star
29

CelesteSavefileMerger

Savefile Merger for Celeste
C#
1
star
30

bevy-pipelined-testing

Rust
1
star
31

jakobhellermann.github.io

HTML
1
star
32

celestetools

Rust
1
star