Skip to content

egui_speedy2d is a library that helps integrate egui, an immediate mode GUI library, with speeedy2d.

License

Notifications You must be signed in to change notification settings

heretik31/egui_speedy2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

egui_speedy2d

egui_speedy2d is a library that helps integrate egui, an immediate mode GUI library, with speeedy2d, a 2D rendering framework.

Warning

The current version has only been tested on linux platform. It should work on windows platform. Not all features of egui has been tested. The work is still in progress. All merge-requests are welcome.

Basic example

use {
    egui_speedy2d::{WindowHandler, WindowWrapper},
    speedy2d::{color::Color, window::WindowHelper, Graphics2D, Window},
};

fn main() {
    simple_logger::SimpleLogger::new().init().unwrap();
    let window = Window::new_centered("Basic sample", (640, 240)).unwrap();
    window.run_loop(WindowWrapper::new(MyWindowHandler {}))
}

struct MyWindowHandler {}

impl WindowHandler for MyWindowHandler {
    fn on_draw(
        &mut self,
        helper: &mut WindowHelper,
        graphics: &mut Graphics2D,
        egui_ctx: &egui::Context,
    ) {
        graphics.clear_screen(Color::WHITE);
        egui::Window::new("Hello").show(&egui_ctx, |ui| {
            ui.label("World !");
        });
        helper.request_redraw();
    }
}

License

This project is licensed under

Any contribution intentionally submitted for inclusion by you, shall be licensed as above, without any additional terms or conditions.

About

egui_speedy2d is a library that helps integrate egui, an immediate mode GUI library, with speeedy2d.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages