implemented the special drawable interface.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user