Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- namespace DNM {
- public class Sprite {
- public Texture2D? texture;
- public Vector2 position;
- public int width;
- public int height;
- public Sprite(GraphicsDevice graphicsDevice, Texture2D texture, int xPos, int yPos, int width, int height) {
- this.texture = texture;
- position = new Vector2(xPos, yPos);
- this.width = width;
- this.height = height;
- }
- public void Draw(SpriteBatch spriteBatch, Color color) {
- spriteBatch.Draw(texture, position, new Rectangle((int)position.X, (int)position.Y, width, height), color);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement