Native UI development for Nim: https://github.com/nim-lang/uirelays
Extracted from NimEdit so we have some evidence the API scales well. It supports the development of custom drivers, the interface has deliberately been kept minimal.
Coming soon: A tiny DSL for layout computations.
Hi.
Two doubts: Will "uirelays" be having responsive layouts later? Also, the "touch inputs", in case needed for mobile experiments?
How is a UI library being compared to a game library?
I looked at the example code and it’s pretty much identical to what I’d write with raylib – there is a main loop where you react to events and draw the GUI using basic primitives like drawRectangle. I’m struggling to see any significant differences.
From what I can tell, this is an immediate-mode GUI with manual layouting? What are the advantages compared to mature options like Raylib?
That's essentially what it looks to be. Though with a bit of layout support now.
Overall the API would be good for simple apps, but looks hard to scale to more complex apps. Who knows where it could go though.
Start adding things like reusable combo boxes, lists, tables, theming, etc and it starts getting harder. It's sort of where I got to with Figuro and paused -- I'm not happy with ways to combine reusable components without MVC and/or OO patterns.
Meanwhile, I’m building an app in both figdraw and uirelays to learn them. And also submitting PRs. uirelays is wayyyy better than raygui. And I will not bother with C libraries again either. We can make better Nim libraries.
Definitely pure Nim libraries are better!
FigDraw is just to pull out the core rendering pieces and improve upon them. The idea is to provide a high performance renderer for others to build UI libraries on top. I'll probably port uirelays to FigDraw out of curiosity. :)
Start adding things like reusable combo boxes, lists, tables, theming, etc and it starts getting harder.
FWIW I'll turn NimEdit's syntax highlighting text editor into a "widget". It will get us quite far already. There is only text and images.
Theming seems to be a "relay-adapter". Seems easy enough to do.
There you go: https://github.com/nim-lang/uirelays/pull/9
Screenshot included.