mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-26 00:45:20 +00:00
34 lines
764 B
C#
34 lines
764 B
C#
using Microsoft.Xna.Framework;
|
|
using MonoGame.Extended.TextureAtlases;
|
|
|
|
namespace MonoGame.Extended.Gui.Controls
|
|
{
|
|
public class GuiStackPanel : GuiControl
|
|
{
|
|
public GuiStackPanel()
|
|
{
|
|
}
|
|
|
|
public GuiStackPanel(TextureRegion2D backgroundRegion)
|
|
: base(backgroundRegion)
|
|
{
|
|
}
|
|
|
|
|
|
public void PerformLayout()
|
|
{
|
|
var y = Position.Y;
|
|
var x = Position.X;
|
|
|
|
foreach (var control in Controls)
|
|
{
|
|
control.Origin = Vector2.Zero;
|
|
control.Position = new Vector2(x, y);
|
|
control.Size = new Size2(Size.Width, control.Size.Height);
|
|
y += control.Size.Height;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|