SpringGridLayout grid size problem

The key, I think, will be keeping the hacking as low as possible. I feel like most of your issues stem from a partially specified GuiControl holding the 3D child.

Taking a step back, the “right” solution would be to implement your own ModelComponent that is similar to things like IconComponent except that it has a 3D child instead of creating a quad. It could then provide a proper preferred size, participate in resize(), etc… then it would act like any other component and you could just plop it in as the Icon layer of a label/panel/whatever. It could take backgrounds, etc… and act just like any other proper layer.

Short of that, I think you’ll need to add a listener to the GuiControl so that you can still move your geometry around on resize.

If it were me, I’d just roll a new GuiComponent… but I already know how to write them. :slight_smile:

In case it’s not clear, how the spring grid layout works is that it first calculates a preferred size by adding up all of the child preferred sizes. Then if you set a bigger size, it needs to move and reset the size of all of those children. It divides up the extra space depending on the FillMode… so, FillMode.None means it just positions everyone and doesn’t make them any bigger. All of the left over space will be at the end.

I figure you either want your children to stretch or you don’t want any stretching at all and then you can just center the bar and let empty space open up to either side. Either one would be fine with multiple resolutions.

Edit: just remember that if you write your own component, Lemur thinks of things in terms of upper left and your component growing down and right.