- Home /
how to make grid of buttons always fit parent?
Hi,
I'm trying to make a basic panel, with an 8x8 (8 columns x 8 rows) grid of buttons in it. The grid should resize to fill the whole panel (even if the text inside the buttons wraps a bit).
Is this possible?
The closest I have got is the following:
1) Canvas (set to "scale with screen size")
2) Panel (with 2 "grid layout groups", one with fixed column count 8, and the other with fixed row count 8) - (for some reason the Y cell size also needs to be set to 56 on the fixed rown count layout group, in order for the buttons to fit)
3) 64 buttons inside the panel
However, the buttons dont fit properly. The only time they fit the total panel area is when in 16:9 aspect ratio, with all other aspect ratios there is a gap at the bottom. Is there any way to get the buttons (children) to always fit?
Your answer
Follow this Question
Related Questions
Panel grid layout content size and and flicker 0 Answers
How to Stretch objects in grid layout when screen size is changed 0 Answers
How to scale a GUI (Lagacy) grid? 1 Answer
How can i keep global scale of object while instantiate it 1 Answer
GridLayout dynamic cell size based on object count 0 Answers