2019-08-09 19:28:48 +02:00
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
using MLEM.Textures;
|
|
|
|
|
|
|
|
namespace MLEM.Ui.Elements {
|
|
|
|
public class Panel : Element {
|
|
|
|
|
|
|
|
private readonly NinePatch texture;
|
|
|
|
|
2019-08-09 22:04:26 +02:00
|
|
|
public Panel(Anchor anchor, Vector2 size, Point positionOffset, NinePatch texture) : base(anchor, size) {
|
2019-08-09 19:28:48 +02:00
|
|
|
this.texture = texture;
|
2019-08-09 22:04:26 +02:00
|
|
|
this.PositionOffset = positionOffset;
|
2019-08-09 19:28:48 +02:00
|
|
|
this.ChildPadding = new Point(5);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Draw(GameTime time, SpriteBatch batch, Color color) {
|
|
|
|
batch.Draw(this.texture, this.DisplayArea, color);
|
|
|
|
base.Draw(time, batch, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|