-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Abstract plane geometry library for GUI projects #101
Comments
First: a library is always better than a framework (in that sense that it does not constraint anything in terms of architecture in the end product) Second: I think we need to be more precise in terminology. It would be nice if the set of rules been defined more formally. For example:
|
It's also not clear to me what this is asking for. If it's layout model agnostic, it must not be a layout lib (and we have a few of those already anyway), so what is it? |
Sounds like you want a generic solver for set of inequalities. |
Thank you for your responses!
Good point, I put a fix.
It shouldn't enforce hierarchy between shapes, and the way constraints between shape attributes specified should be flexible enough to build, for example, CSS Flexbox layout model as well as CSS Table layout or iOS Autolayout model on top of them. @zakarumych, @Ralith In a nutshell this is an inequality solver, and the library implementation could use one from the Rust crates under the hood. However, my hope that due to domain specific restrictions(the library is till intended to be used by GUI projects specifically) the end implementation could be simpler and maybe more efficient than just a general purpose inequality solver, and also more API-friendly for such project purposes as well. Like The reason I raised this topic and the reason I raised it in Rust Gamedev specifically is that first I think it would be good if there would be a general generic basis library that could be used by many GUI projects under the hood such that they wouldn't have to reinvent the wheel from scratch each time they are making computations of specific widget set system and their layout model. And the second reason(which is more important to Game development) is that unless one is going to build a User Interface of the "office"-like ordinary Desktop applications, most of the current Rust GUI projects are almost useless for advanced game development projects due to a lack of look&feel customization capabilities and the way their widgets are enforced to be rendered and laying out on the screen. Consider these two examples: Hard to imaging one can render something like that using a library like egui, conrod or azule. The user interface examples above are rendering in 3D space driven by already built game engines and have very stylized set of widgets and specific user interaction behavior. So if the game developer is going to implement a video game user interface like the one above, one probably have to do it more or less from scratch. And the general purpose layout solving library that I proposed in this Issue topic could be handy too. |
I guess UIs on screenshots above have pretty much fixed layout. It's not like they need to adapt to particular sizes and dynamically appearing and disappearing widgets like application UIs do. |
@zakarumych Even if the layout is fixed it's not so bad idea to have an automatic way to (pre-)compute this layout. Also the game could be run in window mode as well as in full-screen mode with different screen resolutions. In this case adaptive("responsive") design might still be relevant even for the games that are rendering UI into 3d scenes. |
Size of the in-game monitor does not depend on resolution in which game is rendered. |
You might be interested in https://github.com/dylanede/cassowary-rs. |
@Ralith Thank you. I didn't know about this project, but it looks close to something I was trying to explain, yes. Not sure if it could become a basis for the vast majority of the end GUI frameworks in the Rust ecosystem as I was thinking of, but anyway I like their approach. Anyway, I hope the topic I raised in the Working Group could be helpful and maybe it would initiate a new work towards implementation of the generalized basis for the Rust GUI projects in the future. |
@ozkriff Do you think we should keep the Issue open? Maybe label the thread as |
I have published a follow-up article on this topic, elaborating on the problem in more detail. |
Would be nice if someone take an initiative to implement a render agnostic, widget agnostic and layout model agnostic library that will be responsible to just compute geometry of some abstract set of objects layout in plane based on their shape attributes specified restrictions/interconnections.
The text was updated successfully, but these errors were encountered: