9 releases (breaking)

0.7.0 Oct 27, 2021
0.6.0 Aug 24, 2021
0.5.0 Jun 29, 2021
0.1.0 Mar 23, 2021

#132 in Game dev

Download history 121/week @ 2021-08-15 173/week @ 2021-08-22 30/week @ 2021-08-29 50/week @ 2021-09-05 60/week @ 2021-09-12 83/week @ 2021-09-19 18/week @ 2021-09-26 35/week @ 2021-10-03 156/week @ 2021-10-10 50/week @ 2021-10-17 77/week @ 2021-10-24 53/week @ 2021-10-31 65/week @ 2021-11-07 72/week @ 2021-11-14 53/week @ 2021-11-21 54/week @ 2021-11-28

251 downloads per month
Used in 3 crates

MIT/Apache

16KB
95 lines

egui bindings for macroquad

Latest version Documentation MIT Apache

This is the easiest way to use egui. Just two functions!

Web demo.

Usage

You need to call ui when you need to get information from ui. Then, only after that function you must call draw function when you need to draw egui contents. All this functions should be called each frame and once per frame.

Here is the small example on how to use this library:

use macroquad::prelude::*;

#[macroquad::main("egui with macroquad")]
async fn main() {
    loop {
        clear_background(WHITE);

        // Process keys, mouse etc.

        egui_macroquad::ui(|egui_ctx| {
            egui::Window::new("egui ❤ macroquad")
                .show(egui_ctx, |ui| {
                    ui.label("Test");
                });
        });

        // Draw things before egui

        egui_macroquad::draw();
        
        // Draw things after egui

        next_frame().await;
    }
}

Building

Building for native and for web works just as in macroquad. You can read about it here. Or you could look at building example at egui-miniquad.

But for wasm you will need to include two more .js files, which is plugins for quads, instruction is written here.

Dependencies

~7–9.5MB
~186K SLoC