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.
Layouter - a simple UI grid library
Layouter - a simple UI grid library
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Layouter - a simple UI grid library
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.
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
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 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.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Layouter - a simple UI grid library
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 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
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 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.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Layouter - a simple UI grid library
NICE. I'm sure this is going to be handy for a lot of people
Re: Layouter - a simple UI grid library
One hopes :-) That's what open source is for.pauljessup wrote: ↑Fri Sep 15, 2023 3:31 pm NICE. I'm sure this is going to be handy for a lot of people
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: Layouter - a simple UI grid library
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".
Re: Layouter - a simple UI grid library
Please post here if you use it or at least some screenshots. That will be appreciated.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: Layouter - a simple UI grid library
Fixed a bug that hindered horizontal layout.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 3 guests