예제 #1
0
        public virtual void Draw(SpriteBatch spriteBatch = null)
        {
            SetSpriteBatch(spriteBatch);

            if (IsActive && IsVisible)
            {
                if (Texture != null)
                {
                    switch (DrawMethodType)
                    {
                    case 1:
                        SpriteBatch.Draw(Texture, DestinationRectangle, Color);
                        break;

                    case 2:
                        SpriteBatch.Draw(Texture, Position, Color);
                        break;

                    case 3:
                        SpriteBatch.Draw(Texture, DestinationRectangle, SourceRectangle, Color);
                        break;

                    case 4:
                        SpriteBatch.Draw(Texture, Position, SourceRectangle, Color);
                        break;

                    case 5:
                        SpriteBatch.Draw(Texture, DestinationRectangle, SourceRectangle, Color, Rotation, Origin, SpriteEffects, LayerDepth);
                        break;

                    case 6:
                        SpriteBatch.Draw(Texture, Position, SourceRectangle, Color, Rotation, Origin, Scale, SpriteEffects, LayerDepth);
                        break;

                    case 7:
                        SpriteBatch.Draw(Texture, Position, SourceRectangle, Color, Rotation, Origin, new Vector2(Scale), SpriteEffects, LayerDepth);
                        break;

                    default:
                        SpriteBatch.Draw(Texture, DestinationRectangle, Color);
                        break;
                    }
                }

                foreach (var e in Events)
                {
                    e.Draw();
                }

                TestInfo.Draw();
            }
        }