Example #1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            if (!Hidden)
            {
                NinePatchRegion2D ninePatch = _releasedTexture;
                if (ButtonState == ButtonState.Hover)
                {
                    ninePatch = _hoverTexture;
                }
                if (ButtonState == ButtonState.Pressed)
                {
                    ninePatch = _pressedTexture;
                }

                spriteBatch.Draw(ninePatch,
                                 new Rectangle((int)TopLeft.X,
                                               (int)TopLeft.Y,
                                               (int)Width,
                                               (int)Height),
                                 Color.White);
                SubPanel.Draw(spriteBatch);
            }
        }