Пример #1
0
        public override void Draw(SpriteBatch spriteBatch, PrimitiveDrawer pd, FontHandler fontHandler, GraphicsDevice graphicsDevice)
        {
            vector.X = x;
            vector.Y = y;

            if(true)
            {
                Vector2 measurement = fontHandler.GetSourceCodePro().MeasureString(" " + text + " ");
                width = (int)measurement.X;
                height = (int)measurement.Y;
            }

            if(selected)
                pd.DrawFilledRectangle(graphicsDevice, this, colorOne);
            else
                pd.DrawFilledRectangle(graphicsDevice, this, colorTwo);

            spriteBatch.DrawString(fontHandler.GetSourceCodePro(), " " + text + " ", vector + TetrisGameRunner.GetOffsetVector(), Color.White);
            spriteBatch.End();
            spriteBatch.Begin();
        }