Rename Frame to FillContainer.
This commit is contained in:
@@ -56,9 +56,9 @@ public class TestGame : Game
|
|||||||
Input.AddInputMapping("reload", new IInputAction[] { new KeyInputAction(KeyboardKey.R) });
|
Input.AddInputMapping("reload", new IInputAction[] { new KeyInputAction(KeyboardKey.R) });
|
||||||
_emitterId = _particleSystem.CreateEmitter(Renderer.WindowSize / 2, _fireEffect);
|
_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))
|
if (Input.IsMouseButtonDown(MouseButton.Left))
|
||||||
{
|
{
|
||||||
var mousePos = Input.GetMousePosition();
|
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
|
Gap = 10f
|
||||||
};
|
};
|
||||||
|
|
||||||
private Frame _frame = new();
|
private FillContainer _fillContainer = new();
|
||||||
// private HorizontalContainer _container = new(new Rect(128.0f, 64.0f), new(), 16)
|
// private HorizontalContainer _container = new(new Rect(128.0f, 64.0f), new(), 16)
|
||||||
// {
|
// {
|
||||||
// ConfineToContents = true,
|
// ConfineToContents = true,
|
||||||
|
|||||||
@@ -3,16 +3,17 @@ using Voile.Rendering;
|
|||||||
namespace Voile.UI.Containers;
|
namespace Voile.UI.Containers;
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </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;
|
if (Size == _lastParentSize) return;
|
||||||
|
|
||||||
Size = _lastParentSize;
|
Size = _lastParentSize;
|
||||||
|
|
||||||
Console.WriteLine("Updating");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Rect _lastParentSize = Rect.Zero;
|
private Rect _lastParentSize = Rect.Zero;
|
||||||
Reference in New Issue
Block a user