Use reactive rendering for ui examples. (#4164)
# Objective - Use the low power, reactive rendering settings for UI examples. - Make the feature more discoverable by using it in an applicable context.
This commit is contained in:
parent
1a85fb5ea3
commit
b493165bfe
@ -1,10 +1,12 @@
|
|||||||
use bevy::prelude::*;
|
use bevy::{prelude::*, winit::WinitSettings};
|
||||||
|
|
||||||
/// This example illustrates how to create a button that changes color and text based on its
|
/// This example illustrates how to create a button that changes color and text based on its
|
||||||
/// interaction state.
|
/// interaction state.
|
||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins(DefaultPlugins)
|
.add_plugins(DefaultPlugins)
|
||||||
|
// Only run the app when there is user input. This will significantly reduce CPU/GPU use.
|
||||||
|
.insert_resource(WinitSettings::desktop_app())
|
||||||
.add_startup_system(setup)
|
.add_startup_system(setup)
|
||||||
.add_system(button_system)
|
.add_system(button_system)
|
||||||
.run();
|
.run();
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
use bevy::{
|
use bevy::{
|
||||||
input::mouse::{MouseScrollUnit, MouseWheel},
|
input::mouse::{MouseScrollUnit, MouseWheel},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
winit::WinitSettings,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This example illustrates the various features of Bevy UI.
|
/// This example illustrates the various features of Bevy UI.
|
||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins(DefaultPlugins)
|
.add_plugins(DefaultPlugins)
|
||||||
|
// Only run the app when there is user input. This will significantly reduce CPU/GPU use.
|
||||||
|
.insert_resource(WinitSettings::desktop_app())
|
||||||
.add_startup_system(setup)
|
.add_startup_system(setup)
|
||||||
.add_system(mouse_scroll)
|
.add_system(mouse_scroll)
|
||||||
.run();
|
.run();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user