Code: Select all
Window * parent;
parent->setMaxSize(UVector2(UDim(5,0) , UDim (5, 0)));
parent->setSize(UVector2(UDim(5,0) , UDim (5, 0)));
Window * child1;
child1->setMaxSize(UVector2(UDim(1,0) , UDim (1, 0)))
child1->setSize(UVector2(UDim(1,0) , UDim (1, 0)))
parent->addChildWindow(child1);
Window * child2;
child2->setMaxSize(UVector2(UDim(5,0) , UDim (5, 0)))
child2->setSize(UVector2(UDim(1,0) , UDim (1, 0)))
parent->addChildWindow(child2);
My assumption was that all 3 of these windows would be the same size.
The reality is that child1 is 20% the size of child2 and parent.
This is because max size is not relative to the parent, which is very counter-intuitive.
I realize this is a minor problem but consider changing this in the future.
Also, I should probably note that this example is made up, in my real code the parent is originally size 1 and is later resized to 5, but its max size is always 5, so it could be an update problem i suppose.
I'm using CEGUI 7.5