bevy-contrib-inspector
This crate provides the ability to annotate structs with a #[derive(Inspectable)]
,
which opens a web interface (by default on port 5676) where you can visually edit the values of your struct live.
Example
use Inspectable;
Add the InspectorPlugin
to your App.
use InspectorPlugin;
To automatically open the webbrowser when starting, run your program using BEVY_INSPECTOR_OPEN=1 cargo run
.
Attributes
When deriving the Inspectable
trait, you can set options such like the port the server will run on like so:
The attribute on the struct will accept fields of the type InspectableOptions
,
while the attributes on the fields accept those of their <Type as AsHtml>::Options
.
Demo
Features
native
: Instead of opening the inspector window in a browser, start a webkit2gtk window.
On ubuntu, the feature requires sudo apt install libwebkit2gtk-4.0-dev