Exemple #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            if (!IsReadyToUpdate)
            {
                return;
            }

            // Begin the spritebatch in relation to the camera
            SpriteBatch.Begin(SpriteSortMode.Deferred,
                              null, null, null, null, null,
                              gameCamera.GetTransformation());

            GraphicsDevice.Clear(Color.Black);

            // Let ScreenManager handle the drawing of the current active screen
            ScreenManager.Draw(gameTime);

            base.Draw(gameTime);

            if (DisplayCursor)
            {
                cursor.Draw();
            }

            // FPS
            fpsDisplay?.Draw();

            SpriteBatch.End();
        }
Exemple #2
0
 void Tick(object sender, EventArgs e)
 {
     Render();
     FPS.Draw(device);
     device.WaitForPresent();
 }