Skip to content

Commit

Permalink
Use reactive rendering for ui examples. (bevyengine#4164)
Browse files Browse the repository at this point in the history
# Objective

- Use the low power, reactive rendering settings for UI examples.
- Make the feature more discoverable by using it in an applicable context.
  • Loading branch information
aevyrie committed Jun 7, 2022
1 parent 13da8ab commit 143c3c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/ui/button.rs
Original file line number Diff line number Diff line change
@@ -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
/// interaction state.
fn main() {
App::new()
.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_system(button_system)
.run();
Expand Down
3 changes: 3 additions & 0 deletions examples/ui/ui.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
use bevy::{
input::mouse::{MouseScrollUnit, MouseWheel},
prelude::*,
winit::WinitSettings,
};

/// This example illustrates the various features of Bevy UI.
fn main() {
App::new()
.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_system(mouse_scroll)
.run();
Expand Down

0 comments on commit 143c3c8

Please sign in to comment.