Page 2 of 10

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sun May 19, 2019 5:33 pm
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.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sun May 19, 2019 9:02 pm
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?

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Mon May 20, 2019 2:15 am
by coding.jackalope
Thanks for pointing that out. The link was pointing to an invalid page. The Menus page should be accessible now.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Mon May 20, 2019 4:43 pm
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.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Fri May 24, 2019 2:51 pm
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?

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sat May 25, 2019 5:37 pm
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.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sat May 25, 2019 6:31 pm
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?

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Sat May 25, 2019 8:33 pm
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.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Fri May 31, 2019 11:09 pm
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.

Re: Slab - An Immediate Mode GUI Library In Lua

Posted: Mon Jun 03, 2019 8:43 pm
by Bunnybacon
Hey!

Really excited about this lib!

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

Thanks!