Have we found a good UI paradigm to fit inside Ply? #87
Replies: 4 comments 4 replies
|
I'm starting to think that the |
|
Both FungalEconomics, a real-time strategy game about mycelial expansion, and Stratum, a turn-based strategy game, are available under the Ply Noncommercial License 1 on my GitHub. I don't have any fancy component system going on. Just plain functions, parameters and variables. |
|
I think games can get away with simple systems like these better than non-game apps. But I'm at least delighted to see that the code for these games is open, and I can take a peek. I think I'll stick to |
|
Finally came to a good-ish way to handle multiple root screens. Components are really nice for having section-specific state data. But I'm also using plain Also, signals! Finally found a good way to represent those. Basically: // src/gui/settings.rs
#[derive(Debug, Default)]
pub struct Settings {
// ...
pub request_close: Option<()>, // This is a signal
}
// src/gui.rs
impl Cadenzier {
// ...
pub fn view(&mut self, ui: &mut Ui) {
// ...
// This! `.take()`ing the option if it's there, and doing something with it.
if let Some(()) = settings.request_close.take() {
self.settings = None;
}
// ...
}
}It's a pretty nifty way of bubbling up updates to the parent. Anyway, I'm going to be taking a bit of a hiatus from the GUI, and work a bit on the project format. I like working concurrently like this, once something becomes boring and I don't want to work on it, I switch to a different part of the big task. No team required! |
Uh oh!
There was an error while loading. Please reload this page.
I'm at a bit of a wall with my current component system. Not really sure how to proceed. Main pain points have been:
viewmethods of components, as that would probably lead to argument boilerplate hell, but aOnceCell<RwLock<Config>>staticalso isn't doing the trick.Red Dev, you're making a game using Ply yourself, do you feel like maybe sharing some knowledge of some systems you've come up with? Is any help of the above problems to be expected from the Ply engine itself?
All reactions