24 lines
730 B
C#

using SlatedGameToolkit.Framework.Graphics.Meshes;
using SlatedGameToolkit.Framework.Graphics.Textures;
namespace SlatedGameToolkit.Framework.Graphics.Render
{
public class Sprite2D : RectangleMesh, IRenderable
{
public Texture Texture { get; private set; }
public Sprite2D(Texture texture) {
this.Texture = texture;
this.textureCoords[0].X = -1;
this.textureCoords[0].Y = -1;
this.textureCoords[1].X = 1;
this.textureCoords[1].Y = -1;
this.textureCoords[2].X = 1;
this.textureCoords[2].Y = 1;
this.textureCoords[3].X = -1;
this.textureCoords[3].Y = 1;
}
}
}