42 lines
821 B
C#
42 lines
821 B
C#
using System.Numerics;
|
|
using Voile.Input;
|
|
using Voile.Rendering;
|
|
|
|
namespace Voile.UI;
|
|
|
|
public interface IElement
|
|
{
|
|
public Vector2 Position { get; set; }
|
|
public Rect Size { get; set; }
|
|
}
|
|
|
|
public interface IParentableElement
|
|
{
|
|
public IReadOnlyList<IElement> Children { get; }
|
|
public void AddChild(IElement child);
|
|
}
|
|
|
|
public interface IResizeableElement
|
|
{
|
|
/// <summary>
|
|
/// Get a minimum rectangle size for this element.
|
|
/// </summary>
|
|
public abstract Rect MinimumRect { get; }
|
|
}
|
|
|
|
public interface IUpdatableElement
|
|
{
|
|
void Update();
|
|
}
|
|
|
|
public interface IRenderableElement
|
|
{
|
|
public bool Visible { get; set; }
|
|
public void Render(RenderSystem renderer, Style style);
|
|
}
|
|
|
|
public interface IInputElement
|
|
{
|
|
public bool IgnoreInput { get; set; }
|
|
void Input(IInputAction action);
|
|
} |