Rename Frame to FillContainer.

This commit is contained in:
2025-06-24 23:48:31 +02:00
parent 389a73cf24
commit 5bf052db96
2 changed files with 9 additions and 10 deletions

View File

@@ -56,9 +56,9 @@ public class TestGame : Game
Input.AddInputMapping("reload", new IInputAction[] { new KeyInputAction(KeyboardKey.R) });
_emitterId = _particleSystem.CreateEmitter(Renderer.WindowSize / 2, _fireEffect);
_frame.AddChild(_container);
_fillContainer.AddChild(_container);
_uiSystem.AddElement(_frame);
_uiSystem.AddElement(_fillContainer);
}
@@ -84,7 +84,7 @@ public class TestGame : Game
if (Input.IsMouseButtonDown(MouseButton.Left))
{
var mousePos = Input.GetMousePosition();
_frame.Size = new Rect(mousePos.X, mousePos.Y);
_fillContainer.Size = new Rect(mousePos.X, mousePos.Y);
}
}
@@ -139,7 +139,7 @@ public class TestGame : Game
Gap = 10f
};
private Frame _frame = new();
private FillContainer _fillContainer = new();
// private HorizontalContainer _container = new(new Rect(128.0f, 64.0f), new(), 16)
// {
// ConfineToContents = true,

View File

@@ -3,16 +3,17 @@ using Voile.Rendering;
namespace Voile.UI.Containers;
/// <summary>
/// A frame is a special container that occupies the entire available size of the parent.
/// A special container that occupies the entire available size of the parent. <br />
/// Usually used as a root element for the UI system.
/// </summary>
public class Frame : Container
public class FillContainer : Container
{
public Frame()
public FillContainer()
{
}
public Frame(Rect minimumSize) : base(minimumSize)
public FillContainer(Rect minimumSize) : base(minimumSize)
{
}
@@ -54,8 +55,6 @@ public class Frame : Container
if (Size == _lastParentSize) return;
Size = _lastParentSize;
Console.WriteLine("Updating");
}
private Rect _lastParentSize = Rect.Zero;