Crate bevy_egui_next

Source
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:

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§

EguiClipboard
A resource for accessing clipboard.
EguiContext
A component for storing bevy_egui_next context.
EguiContextQuery
Queries all the Egui related components.
EguiContextQueryItem
Automatically generated WorldQuery item type for EguiContextQuery, returned when iterating over query results.
EguiContextQueryReadOnly
Automatically generated WorldQuery type for a read-only variant of EguiContextQuery.
EguiContextQueryReadOnlyItem
Automatically generated WorldQuery item type for EguiContextQueryReadOnly, returned when iterating over query results.
EguiContexts
A helper SystemParam that provides a way to get [EguiContext] with less boilerplate and combines a proxy interface to the EguiUserTextures resource.
EguiInput
Is used for storing Egui context input..
EguiManagedTexture
Represents a texture allocated and painted by Egui.
EguiManagedTextures
Contains textures allocated and painted by Egui.
EguiMousePosition
A resource for storing bevy_egui_next mouse position.
EguiOutput
Is used for storing Egui output.
EguiPlugin
Adds all Egui resources and render graph nodes.
EguiRenderOutput
Is used for storing Egui shapes and textures delta.
EguiSettings
A resource for storing global UI settings.
EguiUserTextures
A resource for storing bevy_egui_next user textures.
RenderGraphConfig
Egui’s render graph config.
WindowSize
Stores physical size and scale factor, is used as a helper to calculate logical size.

Enums§

EguiSet
The bevy_egui_next plugin system sets.
EguiStartupSet
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.