MyGame.LevelScreen.Draw C# (CSharp) Method

Draw() public method

This method renders the current state.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The elapsed game time.
return void
        public override void Draw(GameTime gameTime)
        {
            Game.GraphicsDevice.Clear(backgroundColor);
            spriteBatch.Begin();

            String text1 = "Level " + myGame.currentLevel;
            String text2 = "Press Enter to Continue";
            spriteBatch.DrawString(bigFont, text1, findCenteredPos(text1, bigFont), menuItemColor);
            spriteBatch.DrawString(smallFont, text2, findCenteredPos(text2, smallFont) +
                new Vector2(0,bigFont.MeasureString(text1).Y), menuItemColor);
            //Vector2 nextPosOffset = Vector2.Zero ;
            //Vector2 pos;
            //for (int i = 0; i < menuItems.Count(); i++)
            //{

            //    pos = findCenteredPos(menuItems[i], mediumFont) + nextPosOffset;
            //    spriteBatch.DrawString(mediumFont, menuItems[i], pos, menuItemColor);
            //    nextPosOffset += new Vector2(0, mediumFont.MeasureString(menuItems[i]).Y);
            //    pos = findCenteredPos(menuItemsDescription[i], smallFont) + nextPosOffset;
            //    spriteBatch.DrawString(smallFont, menuItemsDescription[i], pos, menuItemDescriptionColor);
            //    nextPosOffset += new Vector2(0, smallFont.MeasureString(menuItemsDescription[i]).Y);
            //}

            spriteBatch.End();
            base.Draw(gameTime);
        }