Update arrangement logic for containers, remove position property from Rect, add Size property to IElement.

This commit is contained in:
2025-06-19 15:08:23 +02:00
parent e499691714
commit 6affded730
9 changed files with 56 additions and 23 deletions

View File

@@ -67,9 +67,9 @@ public class TestGame : Game
_particleSystem!.RestartEmitter(_emitterId);
}
if (Input.KeyboardKeyJustPressed(KeyboardKey.One))
if (Input.IsActionPressed("accept"))
{
_container.AddChild(new RectangleWidget(new Rect(Vector2.Zero, 32.0f, 32.0f), MathUtils.RandomColor()));
_container.AddChild(new RectangleWidget(new Rect(32.0f, 32.0f), MathUtils.RandomColor()));
}
if (Input.IsMouseButtonDown(MouseButton.Left))
@@ -117,5 +117,5 @@ public class TestGame : Game
private ResourceRef<Sound> _sound;
private ResourceRef<Texture2d> _icon;
private HorizontalContainer _container = new(spacing: 64.0f);
private HorizontalContainer _container = new(spacing: 8.0f);
}