Game-Design / Sprint3_actual / Inventory / InventorySprite.cs
InventorySprite.cs
Raw
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Sprint3_actual;

namespace Sprint3_actual
{
    public class InventorySprite : ISprite
    {
        private Texture2D Texture { get; set; }

        // Vector2 itemPos;

        private Rectangle sourceRectangle;
        private Rectangle destinationRectangle;

        public InventorySprite(Texture2D texture, int sourceX, int sourceY, int spriteWidth, int spriteHeight, int destX, int destY)
        {
            Texture = texture;

            sourceRectangle = new Rectangle(sourceX, sourceY, spriteWidth, spriteHeight);
            destinationRectangle = new Rectangle(destX, destY, spriteWidth*3, spriteHeight*3);
        }

        public void draw()
        {
            GlobalVars.spriteBatch.Draw(Texture, destinationRectangle, sourceRectangle, Color.White);
        }

        public void update(GameTime gametime)
        {
            //NO-OP for now...
        }
    }
}