Slab - An Immediate Mode GUI Library In Lua

Showcase your libraries, tools and other projects that help your fellow love users.
coding.jackalope
Prole
Posts: 29
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by coding.jackalope »

yintercept wrote: Sat May 18, 2019 6:59 pm Jackalope just wanted to say thanks for this fantastic little library.

I tried Nuklear and despite my damndest, everything compiled, but it just didn't run for me. No error. No UI. Think I needed to run with '--fused' or something, but anyway. Tried slab, got it working first try. Your documentation is great too.

Your library has been a big help getting my tile editor to up and running quickly.

Thank you man.
I'm happy to hear this library has helped you make progress on your project. If you run into any issues or have any suggestions to help improve the library, feel free to reach out and let me know.
User avatar
yintercept
Citizen
Posts: 64
Joined: Mon Apr 02, 2018 3:31 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by yintercept »

Heads up the docs for the menu/menubar component just redirect to the main wiki.

I can figure it out from the api source anyhow, but others might have trouble.

I take it is there or it's just not documented yet?
Last edited by yintercept on Mon May 20, 2019 4:41 pm, edited 1 time in total.
Back in the saddle again.
coding.jackalope
Prole
Posts: 29
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by coding.jackalope »

Thanks for pointing that out. The link was pointing to an invalid page. The Menus page should be accessible now.
User avatar
yintercept
Citizen
Posts: 64
Joined: Mon Apr 02, 2018 3:31 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by yintercept »

Cool, thanks Jack.

I'm literally implementing a menubar *today*. You fixed that fast. It's just 'new scene' and 'export' menu options, woopdeedoo, but Slab actually makes implementing small things like this enjoyable again. Thanks.
Back in the saddle again.
User avatar
yintercept
Citizen
Posts: 64
Joined: Mon Apr 02, 2018 3:31 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by yintercept »

I added an OnHover option to the text, window, tree, and button elements.

I've only used Git a few times, should I do a pull request or something?
Back in the saddle again.
coding.jackalope
Prole
Posts: 29
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by coding.jackalope »

Yeah, go ahead and do a pull request.

Also, there is a function that already detects if a control is hovered after the control is declared. Slab.IsControlHovered will cover all controls that are supported by Slab.
User avatar
yintercept
Citizen
Posts: 64
Joined: Mon Apr 02, 2018 3:31 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by yintercept »

Pardon, I currently have my head keyboard stuck to my forehead.

Added OnHover as one of the options in any case, calls whatever function is passed in when the element detects a hover.

But if Slab.IsControlHovered already exists is the additional option really worth doing a PR for?
Last edited by yintercept on Sat May 25, 2019 9:19 pm, edited 1 time in total.
Back in the saddle again.
coding.jackalope
Prole
Posts: 29
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by coding.jackalope »

Yeah, I would hold off on the PR for now and use the IsControlHovered function. It allows you to keep the standard behavior of controls while also allowing hover detection with that function.
User avatar
yintercept
Citizen
Posts: 64
Joined: Mon Apr 02, 2018 3:31 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by yintercept »

I encountered the following problem..

xdelta, ydelta = slab.GetMouseDelta()
slab.Text(v.name)
if slab.IsControlClicked()
print "ydelta: " .. ydelta -- ydelta is ALWAYS 0
end


Don't know whats going on, if it's on my end, or if it's a bug or maybe it's something to do with scope?
I tried printing it before and after slab.Text, and before and after slab.IsControlClicked, it's only 0 inside the if statement.
Back in the saddle again.
User avatar
Bunnybacon
Prole
Posts: 20
Joined: Fri Mar 25, 2016 8:42 am

Re: Slab - An Immediate Mode GUI Library In Lua

Post by Bunnybacon »

Hey!

Really excited about this lib!

Any easy way to know whether a click is inside or outside the UI layer?

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests