Esempio n. 1
0
        public void DrawDebug(GameTime gameTime, SpriteBatch spriteBatch, Camera camera)
        {
            gameObjects.DrawDebug(gameTime, spriteBatch, newCamera);

            float deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

            frameCounter.Update(deltaTime);

            float      frameRate = (float)Math.Round(frameCounter.AverageFramesPerSecond * 10) / 10;
            string     fps       = string.Format("FPS: {0}", frameRate);
            SpriteFont sf        = GameEnvironment.AssetManager.GetFont("Arial26");

            spriteBatch.DrawString(sf, fps, new Vector2(1, 100), Color.Red);
        }