SirMallard / Iris

Iris is an Immediate-Mode GUI Library for Roblox for creating debug and visualisation UI and tools, based on Dear ImGui,
https://sirmallard.github.io/Iris/
MIT License
164 stars 25 forks source link

Added Radio Buttons, Collapsing Headers and other tweaks. #11

Closed SirMallard closed 1 year ago

SirMallard commented 1 year ago

Additions:

Radio Buttons

Collapsing Headers

Tweaks:

Notes:

Michael-48 commented 1 year ago

Fantastic work, I looked through the code and tested both widgets; I couldn't have written them better myself. All the other tweaks are great and collapsing headers in DemoWindow looks great.

I wish i had heard of RoImGui, looking through the repository it looks about as fleshed out as Iris, maybe even more so. Hopefully more widgets and design ideas from RoImGui can be integrated into Iris. Comparing and contrasting the differences in implementation between RoImGui and Iris is endlessly facinating, and I can see a huge thought has been put into the design of RoImGui.

As for refactoring widgets into their own files, I think this would be a sound idea. I originally opted not to, to mimic the file structure of Dear ImGui. I think this refactor works best if Iris were released as a bundled single file, as done by https://github.com/TechHog8984/Iris. This way, users of the library aren't burdened by the internal structure of the code, a guiding principal of Dear ImGui.

SirMallard commented 1 year ago

That seems like a smart idea regarding bundling files. That would definitely be a simpler way to manage Iris on a user's end. For developlment, the widget files would need to be split down whilst still having access to the utility functions which every widget uses. I'm not sure about the best way to orgnaise this but I'm might make an attempt.

I'm also wondering whether it would be smarter to turn collapsing headers into Tree Nodes but just with additional arguments/flags passed in by default. This is what ImGui does with a FramePadding and NoIndent flags. This would be slightly easier but would also end up adding a bunch more update code to the Tree Nodes. I might also have a look at combining them together.

Regarding my own development of an ImGui I might say a bit about the differences. My approach is very similar to the way ImGui does it. I don't rely on any Roblox events or UI components except the basic Frame or TextLabel. Therefore, the interaction events are all done through a simple but custom check for each widget every frame. Additionally, all the widgets are placed manually and do not rely on UILIstLayouts to organise them. This gives some extra control but ultimately makes the cost of having a large number of components very high. My library is ultimately not very performant, but since Iris relies on Roblox provided UI management and events, that compomise of slightly less control seems worth it for the better performance. Ultimately, I would say Iris has the better implementation and I'll see if there are any features which could be moved from RoImGui to Iris.