#bevy #egui #bevy-engine #ukrainian

bevy_egui

A plugin for Egui integration into Bevy

29 releases (15 breaking)

Uses new Rust 2021

0.15.0 Jul 30, 2022
0.13.0 Apr 16, 2022
0.12.1 Mar 13, 2022
0.8.0 Nov 27, 2021
0.0.1 Aug 14, 2020

#768 in Game dev

Download history 1357/week @ 2022-04-22 1233/week @ 2022-04-29 1655/week @ 2022-05-06 2189/week @ 2022-05-13 1689/week @ 2022-05-20 1895/week @ 2022-05-27 1706/week @ 2022-06-03 1158/week @ 2022-06-10 1689/week @ 2022-06-17 1587/week @ 2022-06-24 1375/week @ 2022-07-01 1136/week @ 2022-07-08 1193/week @ 2022-07-15 1105/week @ 2022-07-22 2197/week @ 2022-07-29 2520/week @ 2022-08-05

7,255 downloads per month
Used in 37 crates (23 directly)

MIT license

105KB
1.5K SLoC

Stand With Ukraine

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

Dependencies

On Linux, this crate requires certain parts of XCB are installed on your system. On Debian-based systems, these can be installed with the command:

$ sudo apt install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

Usage

Here's a minimal usage example:

# Cargo.toml
[dependencies]
bevy = "0.7"
bevy_egui = "0.15"
use bevy::prelude::*;
use bevy_egui::{egui, EguiContext, EguiPlugin};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(EguiPlugin)
        // Systems that create Egui widgets should be run during the `CoreStage::Update` stage,
        // or after the `EguiSystem::BeginFrame` system (which belongs to the `CoreStage::PreUpdate` stage).
        .add_system(ui_example)
        .run();
}

fn ui_example(mut egui_context: ResMut<EguiContext>) {
    egui::Window::new("Hello").show(egui_context.ctx_mut(), |ui| {
        ui.label("world");
    });
}

For a more advanced example, see examples/ui.rs.

cargo run --example ui

See also

Bevy support table

Note: if you're looking for a bevy_egui version that supports main branch of Bevy, check out open PRs, there's a great chance we've already started working on the future Bevy release support.

bevy bevy_egui
0.8 0.15
0.7 0.13-0.14
0.6 0.10-0.12
0.5 0.4-0.9
0.4 0.1-0.3

Dependencies

~20–30MB
~596K SLoC