From 6ede030138dcb7b2c9dd9f84bd20fe058f69f87c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 14 Aug 2019 22:06:06 +0200 Subject: [PATCH] make image texture not read only --- MLEM.Ui/Elements/Image.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MLEM.Ui/Elements/Image.cs b/MLEM.Ui/Elements/Image.cs index 55df7f7..1b1134a 100644 --- a/MLEM.Ui/Elements/Image.cs +++ b/MLEM.Ui/Elements/Image.cs @@ -7,20 +7,20 @@ namespace MLEM.Ui.Elements { public class Image : Element { public Color Color = Color.White; - private readonly TextureRegion texture; + public TextureRegion Texture; private readonly bool scaleToImage; public Image(Anchor anchor, Vector2 size, TextureRegion texture, bool scaleToImage = false) : base(anchor, size) { - this.texture = texture; + this.Texture = texture; this.scaleToImage = scaleToImage; } protected override Point CalcActualSize(Rectangle parentArea) { - return this.scaleToImage ? this.texture.Size : base.CalcActualSize(parentArea); + return this.scaleToImage ? this.Texture.Size : base.CalcActualSize(parentArea); } public override void Draw(GameTime time, SpriteBatch batch, float alpha, Point offset) { - batch.Draw(this.texture, this.DisplayArea.OffsetCopy(offset), this.Color * alpha); + batch.Draw(this.Texture, this.DisplayArea.OffsetCopy(offset), this.Color * alpha); base.Draw(time, batch, alpha, offset); }