Crate bevy_egui[−][src]
This crate provides a Egui integration for the Bevy game engine.
Trying out:
An example WASM project is live at mvlabat.github.io/bevy_egui_web_showcase [source].
Features:
- Desktop and web (bevy_webgl2) platforms support
- Clipboard (web support is limited to the same window, see rust-windowing/winit#1829)
- Opening URLs
- Multiple windows support (see ./examples/two_windows.rs)
bevy_egui
can be compiled with using only bevy
and egui
as dependencies: manage_clipboard
and open_url
features,
that require additional crates, can be disabled.
Usage
Here’s a minimal usage example:
use bevy::prelude::*; use bevy_egui::{egui, EguiContext, EguiPlugin}; fn main() { App::build() .add_plugins(DefaultPlugins) .add_plugin(EguiPlugin) .add_system(ui_example.system()) .run(); } fn ui_example(egui_context: Res<EguiContext>) { egui::Window::new("Hello").show(egui_context.ctx(), |ui| { ui.label("world"); }); }
For a more advanced example, see examples/ui.rs.
cargo run --example ui
See also
Re-exports
pub use egui; |
Modules
node | The names of |
Structs
EguiContext | A resource for storing |
EguiInput | Is used for storing the input passed to Egui. The actual resource is a [ |
EguiOutput | Is used for storing Egui output. The actual resource is [ |
EguiPlugin | Adds all Egui resources and render graph nodes. |
EguiSettings | A resource for storing global UI settings. |
EguiShapes | Is used for storing Egui shapes. The actual resource is [ |
RenderGraphConfig | Egui’s render graph config. |
Enums
EguiStage | The names of |
EguiSystem | The names of egui systems. |
Constants
EGUI_PIPELINE_HANDLE | A handle pointing to the egui [ |
EGUI_TEXTURE_RESOURCE_BINDING_NAME | Name of the texture uniform. |
EGUI_TRANSFORM_RESOURCE_BINDING_NAME | Name of the transform uniform. |
Functions
setup_pipeline | Set up egui render pipeline. |