1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-23 05:08:34 +01:00
MLEM/MLEM.Extended/Extensions/SpriteBatchExtensions.cs

24 lines
1.1 KiB
C#
Raw Normal View History

2019-08-06 14:26:51 +02:00
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Textures;
using MonoGame.Extended;
2019-08-06 14:26:51 +02:00
using MonoGame.Extended.BitmapFonts;
namespace MLEM.Extended.Extensions {
public static class SpriteBatchExtensions {
public static void Draw(this SpriteBatch batch, Texture2D texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth) {
batch.Draw(texture, destinationRectangle.ToMlem(), sourceRectangle, color, rotation, origin, effects, layerDepth);
}
public static void Draw(this SpriteBatch batch, Texture2D texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color) {
batch.Draw(texture, destinationRectangle, sourceRectangle, color, 0, Vector2.Zero, SpriteEffects.None, 0);
}
public static void Draw(this SpriteBatch batch, Texture2D texture, RectangleF destinationRectangle, Color color) {
batch.Draw(texture, destinationRectangle, null, color);
}
2019-08-06 14:26:51 +02:00
}
}