mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-26 00:45:20 +00:00
27 lines
857 B
C#
27 lines
857 B
C#
using Microsoft.Xna.Framework;
|
|
using MonoGame.Extended.TextureAtlases;
|
|
|
|
namespace MonoGame.Extended.Gui.Controls
|
|
{
|
|
public abstract class GuiLayoutControl : GuiControl
|
|
{
|
|
protected GuiLayoutControl()
|
|
: this(null)
|
|
{
|
|
}
|
|
|
|
protected GuiLayoutControl(TextureRegion2D backgroundRegion)
|
|
: base(backgroundRegion)
|
|
{
|
|
Origin = Vector2.Zero;
|
|
}
|
|
|
|
public abstract void Layout(RectangleF rectangle);
|
|
|
|
protected static void PlaceControl(GuiControl control, float x, float y, float width, float height)
|
|
{
|
|
control.Position = new Vector2(x + control.Margin.Left, y + control.Margin.Top);
|
|
control.Size = new Size2(width - control.Margin.Left - control.Margin.Right, height - control.Margin.Top - control.Margin.Bottom);
|
|
}
|
|
}
|
|
} |