Add MarginContainer, mark parent elements dirty when child gets marked dirty too.
This commit is contained in:
@@ -56,7 +56,8 @@ public class TestGame : Game
|
||||
Input.AddInputMapping("reload", new IInputAction[] { new KeyInputAction(KeyboardKey.R) });
|
||||
_emitterId = _particleSystem.CreateEmitter(Renderer.WindowSize / 2, _fireEffect);
|
||||
|
||||
_fillContainer.AddChild(_container);
|
||||
_fillContainer.AddChild(_marginContainer);
|
||||
_marginContainer.AddChild(_container);
|
||||
|
||||
_uiSystem.AddElement(_fillContainer);
|
||||
}
|
||||
@@ -129,21 +130,20 @@ public class TestGame : Game
|
||||
|
||||
private FlexContainer _container = new(minimumSize: new Rect(64.0f, 64.0f), new())
|
||||
{
|
||||
ConfineToContents = true,
|
||||
Anchor = Anchor.Center,
|
||||
Size = new Rect(500, 300),
|
||||
Direction = FlexDirection.Column,
|
||||
Justify = JustifyContent.Start,
|
||||
Align = AlignItems.Center,
|
||||
Wrap = true,
|
||||
Gap = 10f
|
||||
Gap = 8.0f
|
||||
};
|
||||
|
||||
private FillContainer _fillContainer = new();
|
||||
private MarginContainer _marginContainer = new(new Margin(32.0f))
|
||||
{
|
||||
};
|
||||
// private HorizontalContainer _container = new(new Rect(128.0f, 64.0f), new(), 16)
|
||||
// {
|
||||
// ConfineToContents = true,
|
||||
// Anchor = Anchor.CenterRight,
|
||||
// AnchorOffset = new Vector2(0.5f, 0.0f)
|
||||
// };
|
||||
}
|
||||
Reference in New Issue
Block a user