Fix any remaining bugs with anchor positioning system, use LocalPosition for UIElement, and make containers use that for arrangement.

This commit is contained in:
2025-06-24 19:45:18 +02:00
parent b228f04670
commit 03668849bc
13 changed files with 74 additions and 72 deletions

View File

@@ -127,22 +127,22 @@ public class TestGame : Game
private ResourceRef<Sound> _sound;
private ResourceRef<Texture2d> _icon;
// private FlexContainer _container = new(minimumSize: new Rect(64.0f, 64.0f), new())
// {
// ConfineToContents = false,
// Size = new Rect(500, 300),
// Direction = FlexDirection.Column,
// Justify = JustifyContent.Start,
// Align = AlignItems.Center,
// Wrap = true,
// Gap = 10f
// };
private FlexContainer _container = new(minimumSize: new Rect(64.0f, 64.0f), new())
{
Anchor = Anchor.Center,
Size = new Rect(500, 300),
Direction = FlexDirection.Column,
Justify = JustifyContent.Start,
Align = AlignItems.Center,
Wrap = true,
Gap = 10f
};
private Frame _frame = new();
private HorizontalContainer _container = new(new Rect(128.0f, 64.0f), new(), 16)
{
ConfineToContents = true,
Anchor = Anchor.TopRight,
AnchorOffset = new Vector2(1.0f, 0.0f)
};
// private VerticalContainer _container = new(new Rect(128.0f, 64.0f), new(), 16)
// {
// ConfineToContents = true,
// Anchor = Anchor.CenterLeft,
// AnchorOffset = new Vector2(0.5f, 0.0f)
// };
}