Ejemplo n.º 1
0
        /// <summary>
        /// Draws the Texture with the given SpriteBatch
        /// </summary>
        /// <param name="spritebatch"></param>
        public virtual void Draw(SpriteBatch spritebatch, Camera2D camera = null)
        {
            Vector2 r = new Vector2((int)(xPosition), (int)(yPosition));
            if (camera == null || camera.IsInView(r, texture))
            {
                spritebatch.Draw(texture, r, null, Color.White, (float)(Math.PI * 0.5 * (rotation / 90)), new Vector2(texture.Width / 2, texture.Height / 2), 1, SpriteEffects.None, 0);

            }
        }