Page 1 of 1

GUI frame vertical lengh too long

Posted: Fri Sep 02, 2016 1:35 am
by osldgoth
I have a gui frame with children inside, the frame extends well below the last child. I have not been able to figure out how to shorten the frame.
Cut from the red line down:
picture
code snips
on a side issue (maybe related) I'm not even sure how there are two columns. I used to have the children in a table but have since removed the table. Could each child element be adding to the vertical length?

Re: GUI frame vertical lengh too long

Posted: Fri Sep 02, 2016 9:37 pm
by osldgoth
perhaps I have discovered something.
if I remove the caption on the frame the child elements extend to the bottom edge of the frame:
no caption
if I make the caption much longer, the frame becomes wider allowing the child elements to reposition making fewer rows, but the frame height stays the same:
long caption
Is that a bug? my thought is that the frame height would be dynamic like frame width seems to be. or is there some frame setting I need to use?

Re: GUI frame vertical lengh too long

Posted: Fri Sep 02, 2016 9:54 pm
by Helfima
If u use a vertical frame, it try put all children in vertical before
2 way for ur problem
Use a table type guielement with 2 column
Or use a horizontal flow for label and button by row

Re: GUI frame vertical lengh too long

Posted: Sat Sep 03, 2016 2:32 am
by osldgoth
Nevermind, I figured it out, all I need to do is have each "sprite-button"/"button" pair add to maximal_height. Once the frame in question is added to the game I'll set the max height to be 50 (aprox height of caption + some padding),
code
after that it's only a matter of adding a number to that each time a child is added. What could go wrong?

Thanks for all the help

Re: GUI frame vertical lengh too long

Posted: Sat Sep 03, 2016 12:11 pm
by Helfima
Maximal value is juste for frame display. If u have more child is displayed out of the frame