Ejemplo n.º 1
0
        public override void Draw(GameTime gameTime)
        {
            if (!Visible)
            {
                return;
            }

#if SILVERLIGHT
            var color = new Color(Color, MathHelper.Clamp((float)Alpha, 0, 1));
#else
            var color = Color * (float)Alpha;
#endif

            // Top
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X, (int)Position.Y, BorderSize, BorderSize), _leftTopCorner, color);
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X + BorderSize, (int)Position.Y, Width - 2 * BorderSize, BorderSize), _topBorder, color);
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X + Width - BorderSize, (int)Position.Y, BorderSize, BorderSize), _rightTopCorner, color);

            // Middle
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X, (int)Position.Y + BorderSize, BorderSize, Height - 2 * BorderSize), _leftBorder, color);
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X + BorderSize, (int)Position.Y + BorderSize, Width - 2 * BorderSize, Height - 2 * BorderSize), _interior, color);
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X + Width - BorderSize, (int)Position.Y + BorderSize, BorderSize, Height - 2 * BorderSize), _rightBorder, color);

            //bottom
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X, (int)Position.Y + Height - BorderSize, BorderSize, BorderSize), _leftBottomCorner, color);
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X + BorderSize, (int)Position.Y + Height - BorderSize, Width - 2 * BorderSize, BorderSize), _bottomBorder, color);
            _spriteBatch.Draw(_texture, new Rectangle((int)Position.X + Width - BorderSize, (int)Position.Y + Height - BorderSize, BorderSize, BorderSize), _rightBottomCorner, color);

            if (AnimatableString != null)
            {
                AnimatableString.Draw(gameTime);
            }
        }
Ejemplo n.º 2
0
        public override void Draw(GameTime gameTime)
        {
            if (!Visible)
            {
                return;
            }

            base.Draw(gameTime);

            AnimatableString.Draw(gameTime);
        }