fn main() {
    App::new()
        .insert_resource(ClearColor(Color::BLACK))
        .init_resource::<UiState>()
        .add_plugins(
            DefaultPlugins
                .set(LogPlugin {
                    filter: "warn,ui=info".to_string(),
                    level: Level::INFO,
                    ..Default::default()
                })
                .set(WindowPlugin {
                    primary_window: Some(Window {
                        // You may want this set to `true` if you need virtual keyboard work in mobile browsers.
                        prevent_default_event_handling: false,
                        ..default()
                    }),
                    ..default()
                }),
        )
        .add_plugins(EguiPlugin::default())
        .add_systems(Startup, configure_visuals_system)
        .add_systems(Startup, configure_ui_state_system)
        .add_systems(
            EguiContextPass,
            (ui_example_system, update_ui_scale_factor_system),
        )
        .run();
}
This example demonstrates the following functionality and use-cases of bevy_egui:
- rendering loaded assets;
- toggling hidpi scaling (by pressing '/' button);
- configuring egui contexts during the startup.
examples/ui.rs