pub fn run<F>(options: NativeOptions, main_function: F) -> Resultwhere
F: MainFunction,Expand description
The function which starts a window and calls the main_function each frame.
options are passed to eframe::run_native.
ยงExample
use eframe::egui;
use rust_training_tool::gui::run;
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_inner_size([480.0, 360.0]),
..Default::default()
};
run(options, |ctx| {
ctx.painter.circle_filled(
ctx.drawable_area.center(),
ctx.drawable_area.width() * 0.1,
egui::Color32::ORANGE,
);
})
.expect("Can't start game!");