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: 16
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by coding.jackalope » Wed Jul 10, 2019 10:28 pm

Darlex wrote:
Sun Jun 30, 2019 8:24 pm

THANKS! That's way better than my idea! Your GUI project is one of the only ones that doesnt make my brain explode! Send ya good vibes!
Hey Darlex, appreciate the support! The new version just released now has support for highlighting words as well as getting and setting the cursor position. Hope this helps out in your project.
pgimeno wrote:
Sun Jun 30, 2019 8:47 pm
coding.jackalope wrote:
Sun Jun 30, 2019 7:13 pm
I've had plans to add text highlighting to the Input control. I like the idea of specifying the words to highlight like in your example so I'll have something like:

Code: Select all

Slab.Input("code_input", {
	Text = examplecode,
	MultiLine = true,
	H=500, W=500,
	Highlight = {{"function", {0, 0, 1, 1}}, {"end", {0, 0, 1, 1}}, {"local", {0, 0, 1, 1}}, ...}}
where Highlight is a table that takes in a list of words and what color the word should be highlighted in.
Wouldn't it be better to have the words in a table where the keys are the words to highlight? That would avoid more objects, and the lookup would presumably be faster. Iterating would be slower, though, if it's necessary at all.

To put it explicitly, this is what I mean:

Code: Select all

Highlight = {["function"] = {0, 0, 1, 1}, ["end"] = {0, 0, 1, 1}, ["local"] = {0, 0, 1, 1}, ...}
pgimeno, this is a good idea and I went ahead and implemented passing the highlight option in this way. Thanks!

User avatar
Darlex
Party member
Posts: 117
Joined: Sun Sep 24, 2017 10:02 am
Location: absolutely not Chile
Contact:

Re: Slab - An Immediate Mode GUI Library In Lua

Post by Darlex » Thu Jul 11, 2019 12:22 pm

coding.jackalope wrote:
Wed Jul 10, 2019 10:28 pm
Darlex wrote:
Sun Jun 30, 2019 8:24 pm

THANKS! That's way better than my idea! Your GUI project is one of the only ones that doesnt make my brain explode! Send ya good vibes!
Hey Darlex, appreciate the support! The new version just released now has support for highlighting words as well as getting and setting the cursor position. Hope this helps out in your project.
pgimeno wrote:
Sun Jun 30, 2019 8:47 pm
coding.jackalope wrote:
Sun Jun 30, 2019 7:13 pm
I've had plans to add text highlighting to the Input control. I like the idea of specifying the words to highlight like in your example so I'll have something like:

Code: Select all

Slab.Input("code_input", {
	Text = examplecode,
	MultiLine = true,
	H=500, W=500,
	Highlight = {{"function", {0, 0, 1, 1}}, {"end", {0, 0, 1, 1}}, {"local", {0, 0, 1, 1}}, ...}}
where Highlight is a table that takes in a list of words and what color the word should be highlighted in.
Wouldn't it be better to have the words in a table where the keys are the words to highlight? That would avoid more objects, and the lookup would presumably be faster. Iterating would be slower, though, if it's necessary at all.

To put it explicitly, this is what I mean:

Code: Select all

Highlight = {["function"] = {0, 0, 1, 1}, ["end"] = {0, 0, 1, 1}, ["local"] = {0, 0, 1, 1}, ...}
pgimeno, this is a good idea and I went ahead and implemented passing the highlight option in this way. Thanks!
Thanks for listening! (more like reading but anyways) and thanks for making my engine possible!
culdud uwu

coding.jackalope
Prole
Posts: 16
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by coding.jackalope » Tue Aug 13, 2019 6:36 am

Slab v0.6.0

Slab.love
(208.81 KiB) Downloaded 12 times

Hello everyone. Version 0.6.0 has been released. This release adds API functions to allow how controls are organized within a window. Slab now offers users the ability to add project specific stats and can be quickly viewed through the Slab Debug module. The Slab Test module can act as a good reference point for the API. For more information on the update, refer to the wiki page: https://github.com/coding-jackalope/Slab/wiki.

Layout
The layout API allows for controls to be grouped together and aligned to a specific position based on the window. These controls can be aligned to the left, the center, or the right part of a window horizontally. They can also be aligned to the top, the center, or the bottom vertically in a window. Multiple controls can be declared on the same line and the API will properly align the controls on the same line.

Image

Stats
The Slab API offers functions that track the performance of desired sections of code. With these functions coupled together with the debug performance window, end-users will be able to see bottlenecks located within their code base quickly. To display the performance window, call the SlabDebug.Performance function.

Image

Fonts
Fonts can be pushed to a stack to alter the rendering of any text. All controls will use this pushed font until the font is popped from the stack, using the last pushed font or the default font. Below is an example of font being pushed to the stack to render a single text control and then being popped before the next text control.

Image

As always, if anyone has any comments, questions, or suggestions, feel free to reach out and let me know.

twe
Prole
Posts: 1
Joined: Thu Aug 15, 2019 6:28 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by twe » Sat Aug 17, 2019 1:24 am

Cheers for this, was really interested in imgui but the lack of documentation around it (among other things) was pretty off putting. This is great so far :).

coding.jackalope
Prole
Posts: 16
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Post by coding.jackalope » Mon Aug 19, 2019 6:04 pm

twe wrote:
Sat Aug 17, 2019 1:24 am
Cheers for this, was really interested in imgui but the lack of documentation around it (among other things) was pretty off putting. This is great so far :).
Thanks twe! Hope this is helpful for your projects. If you run into any issues or have any questions, let me know.

Post Reply

Who is online

Users browsing this forum: slime and 5 guests