14 breaking releases

0.15.0 Feb 25, 2023
0.13.0 Feb 25, 2023
0.12.0 Oct 1, 2022
0.11.0 May 1, 2022
0.1.0 Mar 23, 2021

#866 in GUI

Download history 557/week @ 2024-07-20 500/week @ 2024-07-27 430/week @ 2024-08-03 396/week @ 2024-08-10 329/week @ 2024-08-17 281/week @ 2024-08-24 277/week @ 2024-08-31 281/week @ 2024-09-07 253/week @ 2024-09-14 356/week @ 2024-09-21 280/week @ 2024-09-28 118/week @ 2024-10-05 195/week @ 2024-10-12 204/week @ 2024-10-19 242/week @ 2024-10-26 370/week @ 2024-11-02

1,013 downloads per month
Used in 6 crates

MIT/Apache

17KB
93 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

~13–21MB
~354K SLoC