Example #1
0
        public Sprite(int textureID, int posX = 0, int posY = 0, int width = 32, int height = 32)
        {
            PixelPosition  = new Vector2(posX, posY);
            TextureID      = textureID;
            Width          = width;
            Height         = height;
            Origin         = new Vector2(0, 0);
            Rotation       = 0;
            TexturePortion = new Rectangle(0, 0, Width, Height);
            DrawingColor   = Color.White;

            _zDelta = DrawingUtils.GetZDelta();
        }
Example #2
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            if (ObjectSprite != null)
            {
                DrawingUtils.DrawRectangle(
                    new Rectangle(
                        (int)Position.X * Engine.TileWidth,
                        (int)Position.Y * Engine.TileHeight,
                        Engine.TileWidth,
                        Engine.TileHeight), Color.Blue);

                ObjectSprite.Draw(spriteBatch);
            }
        }