Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victorkoenders/nova_egui
EGUI extension for https://github.com/17cupsofcoffee/nova
https://github.com/victorkoenders/nova_egui
Last synced: about 1 month ago
JSON representation
EGUI extension for https://github.com/17cupsofcoffee/nova
- Host: GitHub
- URL: https://github.com/victorkoenders/nova_egui
- Owner: VictorKoenders
- License: other
- Created: 2024-11-27T11:57:43.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-27T13:09:46.000Z (about 2 months ago)
- Last Synced: 2024-11-27T14:25:20.780Z (about 2 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NOVA EGUI
Library to be able to use [egui](https://github.com/emilk/egui) with [nova](https://github.com/17cupsofcoffee/nova).
# Example
```rs
fn main() {
let mut app = App::new("Your game", 1280, 720, 60.0);
let mut state = YourState::new(&app);app.run(&mut state);
}struct YourState {
// ...
egui: nova_egui::NovaEguiCtx,
}impl YourState {
fn new(app: &App) -> Self {
Self {
// ...// Initialize the nova egui context
egui: nova_egui::NovaEguiCtx::new(app),
}}
}impl EventHandler for YourState {
fn event(&mut self, app: &mut App, event: nova::input::Event) {
// Propagate any events to egui
self.egui.event(&event);
// ..
}fn update(&mut self, app: &mut App) {
// Notify egui that an update occured
self.egui.update(app);
// ..
}fn draw(&mut self, app: &mut App) {
// ..// At the end, add your egui logic:
self.egui.render(app, |ctx| {
// ctx can be used with the following egui types to get a ui:
// SidePanel, TopBottomPanel, CentralPanel, Window or Area
egui::Window::new("Example").show(ctx, |app, ui| {
// `app` is a mutable reference to the `app` you passed in
// you also have mutable access to `self` here (except for `self.egui`)// `ui` can be used to render egui widgets
ui.label("Hello world!");
});
});
}
}```
Hobby project, use at own risk, etc etc
## License
Licensed under [BBHL](https://lifning.info/BBHL)