-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace the temporary cursor with a toggleable one from yakui
- Loading branch information
Showing
5 changed files
with
89 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use yakui::{align, colored_box, Alignment, Color}; | ||
|
||
pub struct GuiState { | ||
show_gui: bool, | ||
} | ||
|
||
impl GuiState { | ||
pub fn new() -> Self { | ||
GuiState { show_gui: true } | ||
} | ||
|
||
/// Toggles whether the GUI is shown | ||
pub fn toggle_gui(&mut self) { | ||
self.show_gui = !self.show_gui; | ||
} | ||
|
||
/// Prepare the GUI for rendering. This should be called between | ||
/// Yakui::start and Yakui::finish. | ||
pub fn run(&self) { | ||
if !self.show_gui { | ||
return; | ||
} | ||
|
||
align(Alignment::CENTER, || { | ||
colored_box(Color::BLACK.with_alpha(0.9), [5.0, 5.0]); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ mod draw; | |
mod fog; | ||
mod frustum; | ||
mod gltf_mesh; | ||
mod gui; | ||
mod meshes; | ||
mod png_array; | ||
pub mod voxels; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters