yui - declarative GUI library for LÖVE

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
1414codeforge
Prole
Posts: 16
Joined: Fri Aug 05, 2022 1:14 pm
Location: Italy, Sardinia
Contact:

yui - declarative GUI library for LÖVE

Post 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. :?
Last edited by 1414codeforge on Wed Nov 01, 2023 9:49 am, edited 7 times in total.
User avatar
togFox
Party member
Posts: 764
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: yui - declarative GUI library for LÖVE

Post 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.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: yui - declarative GUI library for LÖVE

Post by yetneverdone »

Screenshots of the GUI would be cool :)
User avatar
1414codeforge
Prole
Posts: 16
Joined: Fri Aug 05, 2022 1:14 pm
Location: Italy, Sardinia
Contact:

Re: yui - declarative GUI library for LÖVE

Post 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.
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: yui - declarative GUI library for LÖVE

Post by pgimeno »

Please consider viewtopic.php?f=5&t=92526 too.
User avatar
1414codeforge
Prole
Posts: 16
Joined: Fri Aug 05, 2022 1:14 pm
Location: Italy, Sardinia
Contact:

Re: yui - declarative GUI library for LÖVE

Post 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
Last edited by 1414codeforge on Wed Nov 01, 2023 9:49 am, edited 2 times in total.
User avatar
1414codeforge
Prole
Posts: 16
Joined: Fri Aug 05, 2022 1:14 pm
Location: Italy, Sardinia
Contact:

Re: yui - declarative GUI library for LÖVE

Post 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.
Last edited by 1414codeforge on Wed Nov 01, 2023 9:50 am, edited 1 time in total.
lakotajames
Prole
Posts: 4
Joined: Sun Sep 03, 2023 6:15 am

Re: yui - declarative GUI library for LÖVE

Post 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?
Last edited by lakotajames on Sun Sep 03, 2023 6:25 am, edited 1 time in total.
User avatar
1414codeforge
Prole
Posts: 16
Joined: Fri Aug 05, 2022 1:14 pm
Location: Italy, Sardinia
Contact:

Re: yui - declarative GUI library for LÖVE

Post 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.
lakotajames
Prole
Posts: 4
Joined: Sun Sep 03, 2023 6:15 am

Re: yui - declarative GUI library for LÖVE

Post 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
}}}
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests