StardewModders / mod-ideas

Submit ideas for mods to create, or find your next mod project!
93 stars 5 forks source link

GUI Framework #751

Open WizardsLizards opened 2 years ago

WizardsLizards commented 2 years ago

Creating GUIs is something a lot of modders dread, also their approaches differ (changing the code, drawing over vanilla, etc.) so the possibility of different GUI-changing mods interfering is quite high.

A unified GUI Framework (Focus for now on SMAPI as a library or similar, due to the functionality of GUIs being programmed in C#) would help to both make creating GUIs a lot simpler and beginner friendlier and also help with mod compability (and maybe even routine testing of mod-compability).

What comes to mind first would be an approach of nesting components in each other, with a hierarchie similar to e.g. html or xml.

Another aspect this framework would help with would be scaling, as only the top-component would need to know the size of the screen and everything else would inherit what it needs to know.

tlitookilakin commented 2 years ago

I think if you wanted a full layout engine, you could do something based on flexbox, but I think it would be both easier and more useful to make a library of commonly-used widgets and some kind of wrapper class that glues them together.