NemuiSen / ggegui

A simple implementation of egui for ggez
52 stars 30 forks source link

Right clicking a button spams it rly fast #14

Closed Bowarc closed 1 year ago

Bowarc commented 1 year ago

I'll still take example/basic_template as a base

Replace the ggez::event::EventHandler::update with:

fn update(&mut self, ctx: &mut Context) -> GameResult {
    let gui_ctx = self.gui.ctx();

    const WINDOW_SIZE: (f32, f32) = (300., 130.);

    egui::Window::new("UI")
        .fixed_size(WINDOW_SIZE)
        .show(&gui_ctx, |ui| {
            if ui.button("Click me").clicked() {
                println!("Hello world");
            }
        });
    self.gui.update(ctx);
    Ok(())
}}

sorry again for spamming issues haha im trying to learn this cool crate, so i test a lot of things

NemuiSen commented 1 year ago

i think that https://github.com/NemuiSen/ggegui/commit/2ecc2b99faa70e4f9c4a04d8054c29f6461ac302 also fixed this issue