Page 1 of 2

yui - declarative GUI library for LÖVE

Posted: Wed Aug 17, 2022 4:26 pm
by 1414codeforge
Yui is Yet another User Interface library.

It helps creating menu screens, pause menus, HUDs, and such.
Most of its widget rendering code and theming is taken from the wonderful SUIT library by Matthias Richter (which is beautiful BTW).

I have decided to create yui instead of using one of the many great libraries available
because no other library matched my needs just right.

Source code: https://codeberg.org/1414codeforge/yui
Examples: https://codeberg.org/1414codeforge/yui-examples
Pictures: https://codeberg.org/1414codeforge/yui- ... aster/pics

Distinguishing features
  • Declarative approach to describe the UI (as opposed to SUIT's immediate mode): layout is defined once, events are handled in callbacks.
  • Has built in support for localization thanks to another library I've been working on: moonspeak.
  • Supports custom input device management (keyboard, mouse, touch, gamepads).
  • Easily extensible collection of widgets.
  • Grid layouts.
  • Widget navigation using keyboard/joystick buttons.
Demo

Image

Gotcha

Code is alpha quality at the moment. :death:
Though it is workable. :?

Re: yui - declarative GUI library for LÖVE

Posted: Wed Aug 17, 2022 9:47 pm
by togFox
I'll be checking this out as I was about to roll-my-own.

I notice two dependencies. I'll cheek this two out a well, noting one of them doesn't have mobile friendly documentation.

Re: yui - declarative GUI library for LÖVE

Posted: Thu Aug 18, 2022 6:51 am
by yetneverdone
Screenshots of the GUI would be cool :)

Re: yui - declarative GUI library for LÖVE

Posted: Thu Aug 18, 2022 9:01 am
by 1414codeforge
togFox wrote: Wed Aug 17, 2022 9:47 pm I notice two dependencies. I'll cheek this two out a well, noting one of them doesn't have mobile friendly documentation.
In the README you should find a reference to download the deps conveniently.
Those libraries are general utilities I use in every one of my projects.

Admittedly documentation is lacking at the moment. I'm working on that.
I'll also ready a github mirror in the next few days.
yetneverdone wrote: Thu Aug 18, 2022 6:51 am Screenshots of the GUI would be cool :)
Definitely :3
I'll add some of them along with a few code examples.

For now, the default theme and widgets are aesthetically almost identical to SUIT.

Re: yui - declarative GUI library for LÖVE

Posted: Thu Aug 18, 2022 11:34 am
by pgimeno
Please consider viewtopic.php?f=5&t=92526 too.

Re: yui - declarative GUI library for LÖVE

Posted: Wed Aug 24, 2022 4:05 pm
by 1414codeforge
pgimeno wrote: Thu Aug 18, 2022 11:34 am Please consider viewtopic.php?f=5&t=92526 too.
Oh, such a nice piece of code, I wasn't aware of that, thanks!
Right now yui handles basic single line input boxes.
In the interest of keeping yui reasonably small I don't think that is going to change.
But I could make a yui-extras repository with additional widgets, that's where I could make use of it.

On an unrelated note...

Update: I have created a repository to demonstrate some practical uses of yui:
https://codeberg.org/1414codeforge/yui-examples

My original post has been updated.

PS. And we now have some pics for yetneverdone :3

Re: yui - declarative GUI library for LÖVE

Posted: Wed Nov 09, 2022 2:54 pm
by 1414codeforge
Yet another update:
  • We now have a new home: https://codeberg.org/1414codeforge, contributing is now easier :awesome:
  • Docs are available via ldoc
  • Many bugfixes
  • Customizing each widget's theme is now simpler and consistent
  • Creating new custom widgets is less cumbersome (common drawing functions can be accessed and used outside yui)
TODO:
  • Make input device management more flexible
Main post was updated.

Re: yui - declarative GUI library for LÖVE

Posted: Sun Sep 03, 2023 6:18 am
by lakotajames
This broke when the new constructor was changed in gear. Also, I have no idea how to make an account for gitea.it, so I wasn't able to put in an issue there.

Also, is there a way to use images?

Re: yui - declarative GUI library for LÖVE

Posted: Wed Nov 01, 2023 9:55 am
by 1414codeforge
Sorry for the horribly late reply on this!

We have migrated to codeberg.org precisely because gitea.it has closed public registration:
https://codeberg.org/1414codeforge/yui

There have been a couple of improvements on both gear and yui lately,
so your issue has probably been solved, but I'm now trying to reproduce.

Currently there is no widget for images built into yui, but I believe it can be created easily.
I have implemented a couple of specific widgets for a game I'm creating, I could create a yui-extras repository to make them available without bloating the core lib too much.

Re: yui - declarative GUI library for LÖVE

Posted: Mon Nov 13, 2023 2:20 am
by lakotajames
I've been using your library for a bit, as far as I can tell it's the only library that supports keyboard / joystick controls out of the box.

I have a few questions:

What is the best way to build a custom widget? Just copy paste code out of an existing one, and change it?

Is there a way to get a label to change it's text field dynamically? Because this doesn't work, as far as I can tell:

Code: Select all

test = "Hello World!"
Ui:new{
Rows{
Label{ text = test}, 
Button{ text = "click me!", onHit = function()
test = "Goodbye World!"
end
}}}