GithubHelp home page GithubHelp logo

tdbgamer / bevy-inspector-egui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jakobhellermann/bevy-inspector-egui

0.0 2.0 0.0 1.99 MB

Inspector plugin for the bevy game engine

License: MIT License

Rust 100.00%

bevy-inspector-egui's Introduction

bevy-inspector-egui


This crate provides a debug interface using egui where you can visually edit the values of your components live.

demonstration with a running bevy app

Usage

You can either inspect a single resource using the InspectorPlugin, or use the WorldInspectorPlugin to inspect all entities.

InspectorPlugin

use bevy::prelude::*;
use bevy_inspector_egui::{InspectorPlugin, Inspectable};

#[derive(Inspectable, Default)]
struct Data {
    should_render: bool,
    text: String,
    #[inspectable(min = 42.0, max = 100.0)]
    size: f32,
}

fn main() {
    App::build()
        .add_plugins(DefaultPlugins)
        .add_plugin(InspectorPlugin::<Data>::new())
        .run();
}

World inspector

use bevy::prelude::*;
use bevy_inspector_egui::WorldInspectorPlugin;

fn main() {
    App::build()
        .add_plugins(DefaultPlugins)
        .add_plugin(WorldInspectorPlugin::new())
        .run();
}

world inspector ui

You can configure the WorldInspectorPlugin by inserting the WorldInspectorParams resource. If you want to only display some components, you may want to use the InspectorQuery instead.

If you want custom types to be displayed in the inspector, you'll need to register them on the InspectableRegistry:

use bevy::prelude::*;
use bevy_inspector_egui::{WorldInspector, RegisterInspectable};

#[derive(Reflect)]
struct ReflectedType;

#[derive(Reflect)]
struct InspectableType;

fn main() {
  App::build()
    .add_plugins(DefaultPlugins)
    .add_plugin(WorldInspectorPlugin::new())
    .register_type::<ReflectedType>()
    .register_inspectable::<InspectableType>()
    .run();
}

More examples (with pictures) can be found in the examples folder.

Bevy support table

bevy bevy-inspector-egui
0.5-0.6 0.5
0.5 0.4
0.4 0.1-0.3

bevy-inspector-egui's People

Contributors

danilamihailov avatar haihala avatar icesentry avatar jakobhellermann avatar jamesbeilby avatar rezural avatar timbess avatar wendivoid avatar willcrichton avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.