How hard is it to write gui framework?

I’m curious how hard is it to write gui framework, i heard they might help you with gui organization, and i wanted to try for some practice and control, any ideas?

1 Like

Elaborate on what you think a “gui framework” is homie.

but if u mean a “UI lib”, then it will take some practice to get it done efficiently

2 Likes

It depends on how many features you want to add to your framework. The challenging part is likely in coming up with the initial plan and figuring out how you’d like your framework to work from a coding logic/style perspective.

A simple gui framework might just provide constructors for all the typical UI classes, for example returning a Frame with different “default” properties than what Instance.new("Frame") returns.

A more complex gui framework would add additonal features that aren’t availble “out-of-the-box” using standard Roblox UI classes. For example, a radio button, single selection list, or multiple selection list that your framework provides constructor(s) for and likely some wrapped class with properties and methods for dynamically customizing these custom classes.

3 Likes

Gui frameworks usually handles default components such as buttons logic in gui or animations ect. to take some stress from developer and make him work on his game’s main content

A library would be a better starting point. Difficulty depends a bit on whether it’s for your own use or something you want to make avail to others. If it’s for others, then I’d prob put that idea in the ‘relatively hard’ category.

If it’s for you (and that’s prob how you’d want to start out either way), then it doesn’t have to involve much more work that what coding up a gui for your game would have required anyway (esp if you tend to write things with reusability in mind by default).

Maybe start by adding components you’ve used and like into a shared file. Your lib 1.0 could basically be copying components you’ve collected from your shared file. Think about what you’d like from a lib.

The gui lib I keep for myself started as a collection of gui-related functions that I didn’t want to lose. Over time I developed a list of features I wanted to add:

  • support game and widget guis
  • component creation using blueprints (add comp functionality to non-interactive blueprint)
  • central signal routing
  • automatic maid cleanup
  • etc

Once I had enough ideas that I felt warranted something more than a copy-paste file, I spent around a week setting up a system of modules that supported the features I wanted and then built a basic button component and a tab panel component that worked within that system. With the exception of that week of prelim, the effort to extend it to support new features is no more than what’s needed for normal gui construction. It takes some extra attention since I’m trying to generalize ideas and safeguard things, but it balances out since I can add working sub-components to new composites with minimal effort. Since it’s for me, I can add components as I find a need for them and find hacky workarounds for issues if I need to do that.

Even starting from where I’m at with mine, it would require a lot of effort to ready it for public consumption. If you are thinking of going that route then you might consider making that two separate projects: 1) create a gui lib that is solid and does useful things 2) convert that into something you can publish.
My 2 cents. As a practice thing, you can learn a lot about libraries, guis in general, and Roblox guis specifically by doing this, so there are worse rabbit holes to go down. It doesn’t have to be hard. It can be though. Can check out the Roact lib.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.