{"id":20940008,"url":"https://github.com/vladbat00/bevy_egui","last_synced_at":"2025-05-12T15:37:59.249Z","repository":{"id":37607085,"uuid":"328363870","full_name":"vladbat00/bevy_egui","owner":"vladbat00","description":"This crate provides an Egui integration for the Bevy game engine. 🇺🇦 Please support the Ukrainian army: https://savelife.in.ua/en/","archived":false,"fork":false,"pushed_at":"2025-04-30T18:38:34.000Z","size":750,"stargazers_count":1106,"open_issues_count":36,"forks_count":277,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-08T03:09:56.020Z","etag":null,"topics":["bevy","bevy-engine","egui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vladbat00.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-10T11:11:24.000Z","updated_at":"2025-05-07T13:09:22.000Z","dependencies_parsed_at":"2023-02-16T00:45:18.747Z","dependency_job_id":"50bdf585-9682-41da-a88d-f21e6bec15e3","html_url":"https://github.com/vladbat00/bevy_egui","commit_stats":{"total_commits":334,"total_committers":61,"mean_commits":5.475409836065574,"dds":"0.45508982035928147","last_synced_commit":"69034c683f2c5bf03dcbfc6f8d05fa0479973231"},"previous_names":["vladbat00/bevy_egui","mvlabat/bevy_egui"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladbat00%2Fbevy_egui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladbat00%2Fbevy_egui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladbat00%2Fbevy_egui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladbat00%2Fbevy_egui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vladbat00","download_url":"https://codeload.github.com/vladbat00/bevy_egui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253766768,"owners_count":21960989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","bevy-engine","egui"],"created_at":"2024-11-18T23:05:52.825Z","updated_at":"2025-05-12T15:37:59.228Z","avatar_url":"https://github.com/vladbat00.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)\n\n**Hey!** I'm the author of the crate, and I was born in Mariupol, Ukraine. When russians started the war in 2014, I moved to Kyiv. My parents, who had been staying in Mariupol till the start of the full-scale invasion, barely escaped the city alive. By the moment of writing (November 5th, 2023), we had [874 air raid alerts in Kyiv, and russians managed to bomb the city 132 times](https://air-alarms.in.ua/en/region/kyiv).\n\n**If you are using this crate, please consider donating to any of the listed funds (see the banner above), that will mean a lot to me.**\n\n# `bevy_egui`\n\n[![Crates.io](https://img.shields.io/crates/v/bevy_egui.svg)](https://crates.io/crates/bevy_egui)\n[![Documentation](https://docs.rs/bevy_egui/badge.svg)](https://docs.rs/bevy_egui)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bevyengine/bevy/blob/master/LICENSE)\n[![Downloads](https://img.shields.io/crates/d/bevy_egui.svg)](https://crates.io/crates/bevy_egui)\n[![CI](https://github.com/vladbat00/bevy_egui/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/vladbat00/bevy_egui/actions)\n\nThis crate provides an [Egui](https://github.com/emilk/egui) integration for the [Bevy](https://github.com/bevyengine/bevy) game engine.\n\n**Trying out:**\n\nA basic WASM example is live at [vladbat00.github.io/bevy_egui/ui](https://vladbat00.github.io/bevy_egui/ui/).\n\n**Features:**\n- Desktop and web platforms support\n- Clipboard\n- Opening URLs\n- Multiple windows support (see [./examples/two_windows.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/two_windows.rs))\n- Paint callback support (see [./examples/paint_callback.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/paint_callback.rs))\n- Mobile web virtual keyboard (still rough around the edges and only works without `prevent_default_event_handling` set to `false` in the `WindowPlugin` settings)\n\n![bevy_egui](bevy_egui.png)\n\n## Dependencies\n\nOn Linux, this crate requires certain parts of [XCB](https://xcb.freedesktop.org/) to be installed on your system. On Debian-based systems, these can be installed with the following command:\n\n```bash\nsudo apt install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev\n```\n\n## Usage\n\nHere's a minimal usage example:\n```toml\n# Cargo.toml\n[dependencies]\nbevy = \"0.16.0\"\nbevy_egui = \"0.34.1\"\n```\n\n```rust\nuse bevy::prelude::*;\nuse bevy_egui::{egui, EguiContexts, EguiPlugin, EguiContextPass};\n\nfn main() {\n    App::new()\n        .add_plugins(DefaultPlugins)\n        .add_plugins(EguiPlugin { enable_multipass_for_primary_context: true })\n        .add_systems(EguiContextPass, ui_example_system)\n        .run();\n}\n\nfn ui_example_system(mut contexts: EguiContexts) {\n    egui::Window::new(\"Hello\").show(contexts.ctx_mut(), |ui| {\n        ui.label(\"world\");\n    });\n}\n\n```\n\nNote that this example uses Egui in the [multi-pass mode]((https://docs.rs/egui/0.31.1/egui/#multi-pass-immediate-mode)).\nIf you don't want to be limited to the `EguiContextPass` schedule, you can use the single-pass mode,\nbut it may get deprecated in the future.\n\nFor more advanced examples, see the [examples](#Examples) section below.\n\n### Note to developers of public plugins\n\nIf your plugin depends on `bevy_egui`, here are some hints on how to implement the support of both single-pass and multi-pass modes\n(with respect to the `EguiPlugin::enable_multipass_for_primary_context` flag):\n- Don't initialize `EguiPlugin` for the user, i.e. DO NOT use `add_plugins(EguiPlugin { ... })` in your code,\n  users should be able to opt in or opt out of the multi-pass mode on their own.\n- If you add UI systems, make sure they go into the `EguiContextPass` schedule - this will guarantee your plugin supports both the single-pass and multi-pass modes.\n\nYour plugin code might look like this:\n\n```rust\nuse bevy::prelude::*;\nuse bevy_egui::{egui, EguiContexts, EguiPlugin, EguiContextPass};\n\npub struct MyPlugin;\n\nimpl Plugin for MyPlugin {\n    fn build(\u0026self, app: \u0026mut App) {\n        // Don't add the plugin for users, let them chose the default mode themselves\n        // and just make sure they initialize EguiPlugin before yours.\n        assert!(app.is_plugin_added::\u003cEguiPlugin\u003e());\n\n        app.add_systems(EguiContextPass, ui_system);\n    }\n}\n\nfn ui_system(contexts: EguiContexts) {\n    // ...\n}\n```\n\n## Examples\n\nTo run an example, use the following command (you may replace `ui` with a name of another example):\n\n```bash\ncargo run --example ui\n```\n\n### ui ([live page](https://vladbat00.github.io/bevy_egui/ui), source: [examples/ui.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/ui.rs))\n\nShowcasing some more advanced UI, rendering images, hidpi scaling.\n\n### absorb_input ([live page](https://vladbat00.github.io/bevy_egui/absorb_input), source: [examples/absorb_input.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/absorb_input.rs))\n\nDemonstrating the available options for absorbing input when Egui is using pointer or keyboard.  \n\n### color_test ([live page](https://vladbat00.github.io/bevy_egui/color_test), source: [examples/color_test.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/color_test.rs))\n\nRendering test from [egui.rs](https://egui.rs). We don't fully pass it, help is wanted ([#291](https://github.com/vladbat00/bevy_egui/issues/291)).\n\n### side_panel_2d ([live page](https://vladbat00.github.io/bevy_egui/side_panel_2d), source: [examples/side_panel_2d.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/side_panel_2d.rs))\n\nShowing how to display an Egui side panel and transform a camera with a perspective projection to make rendering centered relative to the remaining screen area.\n\n### side_panel_3d ([live page](https://vladbat00.github.io/bevy_egui/side_panel_3d), source: [examples/side_panel_3d.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/side_panel_3d.rs))\n\nShowing how to display an Egui side panel and transform a camera with a orthographic projection to make rendering centered relative to the remaining screen area.\n\n### render_egui_to_image ([live page](https://vladbat00.github.io/bevy_egui/render_egui_to_image), source: [examples/render_egui_to_image.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/render_egui_to_image.rs))\n\nRendering UI to an image (texture) and then using it as a mesh material texture.\n\n### render_to_image_widget ([live page](https://vladbat00.github.io/bevy_egui/render_to_image_widget), source: [examples/render_to_image_widget.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/render_to_image_widget.rs))\n\nRendering to a texture with Bevy and showing it as an Egui image widget.\n\n### two_windows (source: [examples/two_windows.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/two_windows.rs))\n\nSetting up two windows with an Egui context for each.\n\n### paint_callback ([live page](https://vladbat00.github.io/bevy_egui/paint_callback), source: [examples/paint_callback.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/paint_callback.rs))\n\nUsing Egui paint callbacks.\n\n### simple ([live page](https://vladbat00.github.io/bevy_egui/simple), source: [examples/simple.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/simple.rs))\n\nThe minimal usage example from this readme.\n\n### run_manually ([live page](https://vladbat00.github.io/bevy_egui/run_manually), source: [examples/run_manually.rs](https://github.com/vladbat00/bevy_egui/blob/v0.34.1/examples/run_manually.rs))\n\nThe same minimal example demonstrating running Egui passes manually.\n\n## See also\n\n- [`jakobhellermann/bevy-inspector-egui`](https://github.com/jakobhellermann/bevy-inspector-egui)\n\n## Bevy support table\n\n**Note:** if you're looking for a `bevy_egui` version that supports `main` branch of Bevy, check out [open PRs](https://github.com/vladbat00/bevy_egui/pulls), there's a great chance we've already started working on the future Bevy release support.\n\n| bevy | bevy_egui |\n|------|-----------|\n| 0.16 | 0.34      |\n| 0.15 | 0.31-0.33 |\n| 0.14 | 0.28-0.30 |\n| 0.13 | 0.25-0.27 |\n| 0.12 | 0.23-0.24 |\n| 0.11 | 0.21-0.22 |\n| 0.10 | 0.20      |\n| 0.9  | 0.17-0.19 |\n| 0.8  | 0.15-0.16 |\n| 0.7  | 0.13-0.14 |\n| 0.6  | 0.10-0.12 |\n| 0.5  | 0.4-0.9   |\n| 0.4  | 0.1-0.3   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladbat00%2Fbevy_egui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladbat00%2Fbevy_egui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladbat00%2Fbevy_egui/lists"}