Expand description
This crate provides an Egui integration for the Bevy game engine.
Trying out:
An example WASM project is live at mvlabat.github.io/bevy_egui_next_web_showcase [source].
Features:
- Desktop and web 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_next
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_next::{egui, EguiContexts, EguiPlugin};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(EguiPlugin)
// Systems that create Egui widgets should be run during the `CoreSet::Update` set,
// or after the `EguiSet::BeginFrame` system (which belongs to the `CoreSet::PreUpdate` set).
.add_systems(Update, ui_example_system)
.run();
}
fn ui_example_system(mut contexts: EguiContexts) {
egui::Window::new("Hello").show(contexts.ctx_mut(), |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§
- egui_
node - Egui render node.
- node
- The names of
bevy_egui_next
nodes. - render_
systems - Plugin systems for the render app.
- systems
- Plugin systems.
Structs§
- Egui
Clipboard - A resource for accessing clipboard.
- Egui
Context - A component for storing
bevy_egui_next
context. - Egui
Context Query - Queries all the Egui related components.
- Egui
Context Query Item - Automatically generated
WorldQuery
item type forEguiContextQuery
, returned when iterating over query results. - Egui
Context Query Read Only - Automatically generated
WorldQuery
type for a read-only variant ofEguiContextQuery
. - Egui
Context Query Read Only Item - Automatically generated
WorldQuery
item type forEguiContextQueryReadOnly
, returned when iterating over query results. - Egui
Contexts - A helper SystemParam that provides a way to get
[EguiContext]
with less boilerplate and combines a proxy interface to theEguiUserTextures
resource. - Egui
Input - Is used for storing Egui context input..
- Egui
Managed Texture - Represents a texture allocated and painted by Egui.
- Egui
Managed Textures - Contains textures allocated and painted by Egui.
- Egui
Mouse Position - A resource for storing
bevy_egui_next
mouse position. - Egui
Output - Is used for storing Egui output.
- Egui
Plugin - Adds all Egui resources and render graph nodes.
- Egui
Render Output - Is used for storing Egui shapes and textures delta.
- Egui
Settings - A resource for storing global UI settings.
- Egui
User Textures - A resource for storing
bevy_egui_next
user textures. - Render
Graph Config - Egui’s render graph config.
- Window
Size - Stores physical size and scale factor, is used as a helper to calculate logical size.
Enums§
- EguiSet
- The
bevy_egui_next
plugin system sets. - Egui
Startup Set - The
bevy_egui_next
plugin startup system sets.
Functions§
- setup_
new_ windows_ system - Adds bevy_egui_next components to newly created windows.
- update_
egui_ textures_ system - Updates textures painted by Egui.