mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-06-27 15:01:43 +02:00
24 lines
755 B
C#
24 lines
755 B
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using MLEM.Textures;
|
|
|
|
namespace MLEM.Ui.Elements {
|
|
public class Panel : Element {
|
|
|
|
public static NinePatch DefaultTexture;
|
|
|
|
private readonly NinePatch texture;
|
|
|
|
public Panel(Anchor anchor, Vector2 size, Point positionOffset, NinePatch texture = null) : base(anchor, size) {
|
|
this.texture = texture ?? DefaultTexture;
|
|
this.PositionOffset = positionOffset;
|
|
this.ChildPadding = new Point(5);
|
|
}
|
|
|
|
public override void Draw(GameTime time, SpriteBatch batch, float alpha) {
|
|
batch.Draw(this.texture, this.DisplayArea, Color.White * alpha);
|
|
base.Draw(time, batch, alpha);
|
|
}
|
|
|
|
}
|
|
} |