Update arrangement logic for containers, remove position property from Rect, add Size property to IElement.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user