Layouter - a simple UI grid library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
dusoft
Party member
Posts: 634
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Layouter - a simple UI grid library

Post 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.
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Layouter - a simple UI grid library

Post 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.
User avatar
dusoft
Party member
Posts: 634
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Layouter - a simple UI grid library

Post 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.
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Layouter - a simple UI grid library

Post 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.
User avatar
dusoft
Party member
Posts: 634
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Layouter - a simple UI grid library

Post 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.
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Layouter - a simple UI grid library

Post by pauljessup »

NICE. I'm sure this is going to be handy for a lot of people
User avatar
dusoft
Party member
Posts: 634
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Layouter - a simple UI grid library

Post 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.
User avatar
Pinko
Prole
Posts: 46
Joined: Sat Jul 29, 2023 3:22 pm
Contact:

Re: Layouter - a simple UI grid library

Post by Pinko »

nice! I am a beginner in lua, and i think this could be useful. Thank you!
Author of the vape knigge. I have thought of you! is much better than "i have waited for you". :cool:
User avatar
dusoft
Party member
Posts: 634
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Layouter - a simple UI grid library

Post 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.
User avatar
dusoft
Party member
Posts: 634
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Layouter - a simple UI grid library

Post by dusoft »

Fixed a bug that hindered horizontal layout.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 3 guests