Page 6 of 10

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Wed Aug 19, 2020 2:58 pm
by ki
Thank you for this library, coding.jackalope!

Here's a bug report regarding short mouse clicks. Slab doesn't register most of the clicks I do with my trackpad.

If a mouse click is very short, which means that the interval between "mouse button is pressed down" and "mouse button is released" is somewhere less than 16.66 ms (if Löve is running at 60 FPS), then Slab doesn't recognize the mouse click. This is easy to reproduce when using a trackpad, if the trackpad is configured to register a click when the user lightly taps the trackpad. When testing with macOS and an Apple trackpad, I get clicks that are only about 0,000005 seconds long, as measured by love.timer.getTime() with the callback functions love.mousepressed() and love.mousepressed().

Currently Slab only queries the state of the mouse buttons with love.mouse.isDown() on every update, and if the button was pressed and released between two updates, no click is registered. I think Slab needs to utilize the callback functions love.mousepressed() and love.mousereleased() to track whether a click happened since the last update.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Thu Aug 20, 2020 8:49 am
by pirogronian
ki wrote: Wed Aug 19, 2020 2:58 pm Here's a bug report regarding short mouse clicks. Slab doesn't register most of the clicks I do with my trackpad.

If a mouse click is very short, which means that the interval between "mouse button is pressed down" and "mouse button is released" is somewhere less than 16.66 ms (if Löve is running at 60 FPS), then Slab doesn't recognize the mouse click. This is easy to reproduce when using a trackpad, if the trackpad is configured to register a click when the user lightly taps the trackpad. When testing with macOS and an Apple trackpad, I get clicks that are only about 0,000005 seconds long, as measured by love.timer.getTime() with the callback functions love.mousepressed() and love.mousepressed().

Currently Slab only queries the state of the mouse buttons with love.mouse.isDown() on every update, and if the button was pressed and released between two updates, no click is registered. I think Slab needs to utilize the callback functions love.mousepressed() and love.mousereleased() to track whether a click happened since the last update.
You may check out my today workaround from my fork: https://github.com/pirogronian/Slab , branch MouseEvents. To not messing too much in original code, I introduced separate API:

Code: Select all

WasMousePressed(button, times)
WasMouseReleased(button, times)
WasControlPressed(button, times)
WasControlReleased(button, times)
"times" refers to number of events in "short time and space", according to LOVE wiki. 2 would be "double click" equivalent.

Of course, You must provide appropriate events to Slab, for example:

Code: Select all

function love.mousepressed(x, y, button, istouch, times)
    Slab.MousePressed(x, y, button, istouch, times)
end

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Thu Aug 20, 2020 5:54 pm
by coding.jackalope
ki wrote: Wed Aug 19, 2020 2:58 pm Thank you for this library, coding.jackalope!

Here's a bug report regarding short mouse clicks. Slab doesn't register most of the clicks I do with my trackpad.
Hi ki, good to hear this library is helpful to your project. I am adding this issue to be fixed for the upcoming patch release.
pirogronian wrote: Thu Aug 20, 2020 8:49 am You may check out my today workaround from my fork: https://github.com/pirogronian/Slab , branch MouseEvents. To not messing too much in original code, I introduced separate API:
Thanks for the suggestion pirogronian. Your solution is very similar to what I had planned for the fix and could get around needing developers to forward the mouse and keyboard calls to Slab.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sun Oct 11, 2020 9:24 am
by borr
Сan you show an example of creation node graph with slab?
like this
https://github.com/thedmd/imgui-node-editor

thanks.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Mon Nov 02, 2020 6:16 am
by coding.jackalope
Slab v0.7.1

Slab.love
(224.36 KiB) Downloaded 701 times

Hello everyone. There is a new patch release for Slab. This release provides fixes that have been found since the last release. Some of these fixes required a refactor such as the input system, which now processes input events asynchronously through the Love defined events. Please visit the releases page linked above for more information on the changes made for this release.
borr wrote: Sun Oct 11, 2020 9:24 am Сan you show an example of creation node graph with slab?
like this
https://github.com/thedmd/imgui-node-editor

thanks.
Hi borr, I saw that you posted this question to the project Github and it has been answered there.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Tue Nov 24, 2020 5:38 am
by coding.jackalope
Slab v0.7.2

Slab.love
(225.18 KiB) Downloaded 665 times

Hello everyone. There is a new patch release for Slab. This release provides fixes that have been found since the last release. Some progress has been made for mobile support as a few fixes on those platforms are included. Please visit the releases page linked above for more information on the changes made for this release.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Mon Mar 01, 2021 11:19 pm
by Josepho
Awesome work :)

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Thu Mar 11, 2021 1:08 am
by togFox
I've been procrastinating about building a GUI for my latest project due to LOVE2D forcing 'controls' to be written from scratch but now that I've discovered this I think I'm good to go!!!

I looked through the GITHUB and saw options/radio buttons but I couldn't find a checkbox. Is that included? If I'm clever enough (and I'm probably not!) then I can perhaps suggest some coding for that maybe.

This is great stuff and sorely needed.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sat Mar 13, 2021 6:04 pm
by coding.jackalope
Thanks for the kind words! Glad to hear this project is helping out with yours.

Slab does support check boxes. The documentation for them can be found here.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Tue Mar 16, 2021 9:53 am
by togFox
This would have been crazy hard to do in vanilla Love2D so I'm TOTALLY loving what has happened here. :)

https://cdn.discordapp.com/attachments/ ... nknown.png

This is my gridiron roster with player attributes colour coded in table format. Very nice. And I'll have even more examples soon enough.