#bevy #egui #plugin

bevy_egui

A plugin for Egui integration into Bevy

13 releases (6 breaking)

0.6.1 Jul 20, 2021
0.5.0 May 22, 2021
0.3.0 Mar 2, 2021
0.0.1 Aug 14, 2020
Download history 262/week @ 2021-04-07 269/week @ 2021-04-14 323/week @ 2021-04-21 432/week @ 2021-04-28 333/week @ 2021-05-05 381/week @ 2021-05-12 169/week @ 2021-05-19 233/week @ 2021-05-26 203/week @ 2021-06-02 231/week @ 2021-06-09 223/week @ 2021-06-16 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

1,159 downloads per month
Used in less than 7 crates

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.6"
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.6
0.4 0.1-0.3

Dependencies

~14–27MB
~434K SLoC