コード例 #1
0
        public void Draw(SpriteBatch batch)
        {
            if (Visible)
            {
                batch.Draw(_texture, new Rectangle(Controller.ClientRectangle.Width / 2 - WIDTH / 2,
                                                   Controller.ClientRectangle.Height - HEIGHT + _y, WIDTH, HEIGHT), Color.White);

                var textSize = _fontRenderer.MeasureText(_text, TEXT_SIZE);
                _fontRenderer.DrawText(batch, _text, new Vector2(Controller.ClientRectangle.Width / 2f - textSize.X / 2f,
                                                                 Controller.ClientRectangle.Height - HEIGHT / 2f + _y - textSize.Y / 2f), Color.Black, TEXT_SIZE);
            }
        }