Game-Design / Sprint3_actual / BorderElements / BorderSprite.cs
BorderSprite.cs
Raw
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using System;
using System.Collections.Generic;
using System.Text;

namespace Sprint3_actual.BorderElements
{
    class BorderSprite : ISprite
    {
        private Texture2D Texture;
        private int SpriteWidth;
        private int SpriteHeight;
        private int SpriteX;
        private int SpriteY;
        private Rectangle sourceRectangle;
        private IBorder border;

        public BorderSprite(Texture2D texture, int posX, int posY, int width, int height, IBorder border)
        {
            this.Texture = texture;
            this.SpriteWidth = width;
            this.SpriteHeight = height;
            this.SpriteX = posX;
            this.SpriteY = posY;

            this.border = border;
            this.sourceRectangle = new Rectangle(this.SpriteX, this.SpriteY, this.SpriteWidth, this.SpriteHeight);

        }
        public void draw()
        {

            GlobalVars.spriteBatch.Draw(Texture, border.getPos(), sourceRectangle, Color.White);
        }

        public void update(GameTime gameTime)
        {

        }
    }
}