CEngineSharp_Client.Graphics.GameScreen.Render C# (CSharp) Méthode

Render() public méthode

public Render ( GameTime gameTime ) : void
gameTime GameTime
Résultat void
        public override void Render(GameTime gameTime)
        {
            Window.DispatchEvents();

            Window.Clear();

            if (Client.InGame)
            {
                if (ServiceLocator.WorldManager.MapManager.Map != null)
                {
                    this.Window.SetView(ServiceLocator.WorldManager.PlayerManager.GetPlayer(ServiceLocator.WorldManager.PlayerManager.ClientID).Camera.View);
                    ServiceLocator.WorldManager.MapManager.Map.Draw(Window);
                    this.Window.SetView(_mainView);
                }

                this.GUI.Draw();

                if (this._inventoryVisible)
                    ServiceLocator.WorldManager.PlayerManager.GetPlayer(ServiceLocator.WorldManager.PlayerManager.ClientID).DrawInventory(Window);

                var healthBar = this.GUI.Get<LoadingBar>("healthBar");
                if (ServiceLocator.WorldManager.PlayerManager.GetPlayer(ServiceLocator.WorldManager.PlayerManager.ClientID).Hp != healthBar.Value)
                {
                    healthBar.Value = ServiceLocator.WorldManager.PlayerManager.GetPlayer(ServiceLocator.WorldManager.PlayerManager.ClientID).Hp;
                    healthBar.Text = "HP: " + healthBar.Value + "/" + healthBar.Maximum;
                }
            }

            Window.Display();

            #region Fps Logic

            if (this._fpsTimer < gameTime.TotalElapsedTime)
            {
                this.GUI.Get<Label>("labelFps").Text = "Fps: " + _fpsCounter;
                this._fpsCounter = 0;
                this._fpsTimer = (int)gameTime.TotalElapsedTime + 1000;
            }

            this._fpsCounter++;

            #endregion Fps Logic
        }