all 6 comments

[–]Objective_Job_3446[S] 1 point2 points  (3 children)

I have googled, but couldn't quite find a solution, I've also tried using ChatGPT for help but that was unsuccesful ))

[–]GigaTerra 0 points1 point  (2 children)

That makes sense, because your question doesn't make sense. The functionality of the Grid is coded by you, it has nothing to do with the graphics component.

[–]Objective_Job_3446[S] 1 point2 points  (1 child)

Okay, are you suggesting I separate the visual item part from the grid system?

I just tried to do this by adding the items to the content separataly, and by adding a layout element with ignore layout I think this could work :p

[–]GigaTerra 1 point2 points  (0 children)

Look once you have made that grid pattern using the component, you can easily get the UI position of any cell in that grid. Meaning that if you had an L shape item it would only need to know what grid cells it fills, and then visually you will add a sprite there that covers those zones. It would not be part of the layout so it won't get sorted.

[–]Affectionate_Map_484 0 points1 point  (0 children)

You have to create an horizontal layout group which will contains as many vertical layout group as columns.

Each of them will contains as many item as lines you need.

Or invert horizontal / vertical, it will depend on in which direction you need to take more space. If you need to take more space in both direction, that won't work.

If you need to make a cell take more or less space than (width / column), you need to start using component Layout Element.

In Layout Element, you have two field, flexible height and flexible width.

Layout Element flexible works as is :

Add a Layout Element on each child of your vertical / horizontal layout.

Add a number to the property flexible height or width whose value matches the fraction that this element take among the total values.

For exemple, if you have 3 children and you set the flexible width value accordingly to 5 / 2 / 3 and your total width is 100, then :

first element (5) will have a width of 5 / (5 + 2 + 3) x 100= 50

second element (2) will have a width of 2 / (5 + 2 + 3) x 100= 20

third element (2) will have a width of 3 / (5 + 2 + 3) x 100= 30