#bevy #egui #plugin

bevy_egui

A plugin for Egui integration into Bevy

16 releases (7 breaking)

0.7.1 Oct 5, 2021
0.6.2 Aug 15, 2021
0.6.1 Jul 20, 2021
0.3.0 Mar 2, 2021
0.0.1 Aug 14, 2020
Download history 186/week @ 2021-06-23 308/week @ 2021-06-30 297/week @ 2021-07-07 281/week @ 2021-07-14 259/week @ 2021-07-21 393/week @ 2021-07-28 433/week @ 2021-08-04 322/week @ 2021-08-11 626/week @ 2021-08-18 628/week @ 2021-08-25 324/week @ 2021-09-01 265/week @ 2021-09-08 342/week @ 2021-09-15 326/week @ 2021-09-22 231/week @ 2021-09-29 246/week @ 2021-10-06

1,558 downloads per month
Used in 10 crates (9 directly)

MIT license

105KB
1.5K SLoC

bevy_egui

Crates.io Documentation License Downloads Rust

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:

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.

bevy_egui

Usage

Here's a minimal usage example:

# Cargo.toml
[dependencies]
bevy = "0.5"
bevy_egui = "0.7"
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();
}

// Note the usage of `ResMut`. Even though `ctx` method doesn't require
// mutability, accessing the context from different threads will result
// into panic if you don't enable `egui/multi_threaded` feature.
fn ui_example(egui_context: ResMut<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

Bevy support table

bevy bevy_egui
0.5 0.4-0.7
0.4 0.1-0.3

Dependencies

~14–27MB
~443K SLoC