Ejemplo n.º 1
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            if (Graphic != null)
            {
                if (Animator != null)
                {
                    Animator.Draw(spriteBatch);
                }
                else
                {
                    spriteBatch.Draw(
                        texture: Graphic.Texture2D,
                        position: Position,
                        sourceRectangle: new Rectangle((int)Position.X, (int)Position.Y, Graphic.Width, Graphic.Height),
                        color: Color.White,
                        rotation: Rotation,
                        origin: Origin,
                        scale: Scale,
                        effects: SpriteEffects.None,
                        layerDepth: 0f
                        );
                }
            }

            if (HitBox != null)
            {
                HitBox.Draw(spriteBatch);
            }
        }