implemented the special drawable interface.

This commit is contained in:
2018-12-14 00:42:51 -06:00
parent 28d4f48b51
commit 4fd37b6675
3 changed files with 37 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.DataTypes;
using RecrownedAthenaeum.UI.Modular;
using System;
using System.Collections.Generic;
@@ -9,7 +10,7 @@ using System.Threading.Tasks;
namespace RecrownedAthenaeum.UI.Modular.Modules
{
public class Image : UIModule
public class Image : UIModule, ISpecialDrawable
{
public float rotation = 0f;
public Texture2D Texture { get; set; }
@@ -59,5 +60,14 @@ namespace RecrownedAthenaeum.UI.Modular.Modules
batch.Draw(Texture, bounds, null, color, rotation, origin, SpriteEffects.None, 0f);
base.Draw(batch);
}
public void Draw(SpriteBatch spriteBatch, Rectangle destination, Color color, float rotation = 0, Vector2 origin = default(Vector2))
{
this.color = color;
this.rotation = rotation;
this.origin = origin;
bounds = destination;
Draw(spriteBatch);
}
}
}