From 67e952d64f44e9cf9ec6d316c4f465a01ad6ffb2 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Mon, 16 Dec 2019 21:45:19 -0500 Subject: [PATCH] only draw FPS when debug enabled GitOrigin-RevId: 22783521cbfeb8e7cd672b1bc269acd4c933734c --- Jumpy.Shared/JumpyGame.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jumpy.Shared/JumpyGame.cs b/Jumpy.Shared/JumpyGame.cs index 78ad808..d1ce09c 100644 --- a/Jumpy.Shared/JumpyGame.cs +++ b/Jumpy.Shared/JumpyGame.cs @@ -139,9 +139,13 @@ namespace Jumpy { Rectangle drawRect = new Rectangle( 0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); spriteBatch.Draw(renderTarget, drawRect, Color.White); - string fpsText = $"{GraphicsDevice.Viewport.Width}x{GraphicsDevice.Viewport.Height}, " + - $"{fpsCounter.Fps} FPS"; - spriteBatch.DrawString(font, fpsText, new Vector2(10, 10), Color.White); + + if (Debug.Enabled) { + string fpsText = $"{GraphicsDevice.Viewport.Width}x{GraphicsDevice.Viewport.Height}, " + + $"{fpsCounter.Fps} FPS"; + spriteBatch.DrawString(font, fpsText, new Vector2(10, 10), Color.White); + } + spriteBatch.End(); base.Draw(gameTime);