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: 14
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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests