Page 1 of 2

Layouter - a simple UI grid library

Posted: Wed Sep 13, 2023 8:02 pm
by dusoft
Hey guys,

everybody prefers something else in design and I couldn't find some simple layout library that would suit my needs.

So I wrote one. It is lightly inspired by Bootstrap CSS as it uses grid to place elements.
https://github.com/nekromoff/layouter

I have been using it for one game, so I might develop it more once there is such a need.

Feel free to submit pull requests.

Re: Layouter - a simple UI grid library

Posted: Thu Sep 14, 2023 1:19 pm
by pauljessup
Pretty cool! I made something similar awhile back (never released tho, the code is kind of a mess for mine). Though with mine, I just had it returning position, height and width so that coders could put whatever they want wherever.

Like, you would say container 1 is height of 3, width of 4 (using the similar bootstrap divisible by 12 method), and then each container would have sub-containers for rows and columns, each with their own span. You would then have a function that would get the size and position of each container.

It was a fun project, with some limitations, of course.

Re: Layouter - a simple UI grid library

Posted: Thu Sep 14, 2023 2:37 pm
by dusoft
pauljessup wrote: Thu Sep 14, 2023 1:19 pm Like, you would say container 1 is height of 3, width of 4 (using the similar bootstrap divisible by 12 method), and then each container would have sub-containers for rows and columns, each with their own span. You would then have a function that would get the size and position of each container.
I might do containers (divs) as well and provide more styling options. But really since it's mostly alright for my needs right know, it's up to others interested in forking it and optionally sending a pull request.

Re: Layouter - a simple UI grid library

Posted: Thu Sep 14, 2023 4:43 pm
by pauljessup
Oh no, I get it! I'm not criticising your approach at all. I'm just saying, from one dev to another, cool idea, here's how I did something too. Like, talking shop. Water cooler talk, etc.

I haven't released mine (though I was tempted) just cause...well, it's so basic. But it's super useful for layout to me. Mine is literally just returning x, y, h, w. It doesn't handle any display or anything. Which was what I wanted, a generic way to do nice bootstrap style layouts coords. But not actually handling the nitty gritty.

Yours is more functional than that.

Re: Layouter - a simple UI grid library

Posted: Fri Sep 15, 2023 9:30 am
by dusoft
pauljessup wrote: Thu Sep 14, 2023 4:43 pm Oh no, I get it! I'm not criticising your approach at all. I'm just saying, from one dev to another, cool idea, here's how I did something too. Like, talking shop. Water cooler talk, etc.

I haven't released mine (though I was tempted) just cause...well, it's so basic. But it's super useful for layout to me. Mine is literally just returning x, y, h, w. It doesn't handle any display or anything. Which was what I wanted, a generic way to do nice bootstrap style layouts coords. But not actually handling the nitty gritty.

Yours is more functional than that.
I see. Different approaches are good. I was mostly going for the functional part and the underlying grid was just an afterthought to position elements properly. The one thing I aimed for was zero config. It just works, it takes care of centering and positioning menus, but it also allows for specifying exact coordinates etc., if there is need.

Re: Layouter - a simple UI grid library

Posted: Fri Sep 15, 2023 3:31 pm
by pauljessup
NICE. I'm sure this is going to be handy for a lot of people

Re: Layouter - a simple UI grid library

Posted: Fri Sep 15, 2023 10:56 pm
by dusoft
pauljessup wrote: Fri Sep 15, 2023 3:31 pm NICE. I'm sure this is going to be handy for a lot of people
One hopes :-) That's what open source is for.

Re: Layouter - a simple UI grid library

Posted: Sat Sep 16, 2023 6:30 am
by Pinko
nice! I am a beginner in lua, and i think this could be useful. Thank you!

Re: Layouter - a simple UI grid library

Posted: Sat Sep 16, 2023 4:07 pm
by dusoft
Pinko wrote: Sat Sep 16, 2023 6:30 am nice! I am a beginner in lua, and i think this could be useful. Thank you!
Please post here if you use it or at least some screenshots. That will be appreciated.

Re: Layouter - a simple UI grid library

Posted: Wed Mar 20, 2024 1:14 pm
by dusoft
Fixed a bug that hindered horizontal layout.