コード例 #1
0
ファイル: GameLoop.cs プロジェクト: broem/ClassicUO
 protected override void OnDraw(double frameMS)
 {
     _sceneManager.CurrentScene.Draw(_sb3D, _sbUI);
     _sbUI.GraphicsDevice.Clear(Color.Transparent);
     _sbUI.Begin();
     _uiManager.Draw(_sbUI);
     _infoText.Text = $"FPS: {CurrentFPS}\nObjects: {_sceneManager.CurrentScene.RenderedObjectsCount}\nCalls: {_sb3D.Calls}\nMerged: {_sb3D.Merged}\nPos: {(World.Player == null ? "" : World.Player.Position.ToString())}\nSelected: {(_sceneManager.CurrentScene is GameScene gameScene && gameScene.SelectedObject != null ? gameScene.SelectedObject.ToString() : string.Empty)}";
     _infoText.Draw(_sbUI, new Vector3(Window.ClientBounds.Width - 150, 20, 0));
     _sbUI.End();
 }
コード例 #2
0
        protected override void OnDraw(double frameMS)
        {
            SceneManager.CurrentScene.Draw(_sb3D, _sbUI);
            _sbUI.GraphicsDevice.Clear(Color.Transparent);
            _sbUI.Begin();
            _uiManager.Draw(_sbUI);

            _sb.Clear();
            //_buffer.Clear();

            _sb.ConcatFormat(FORMAT_1, CurrentFPS, SceneManager.CurrentScene.RenderedObjectsCount, _sb3D.Calls, _sb3D.Merged);
            _sb.ConcatFormat(FORMAT_2, _sb3D.FlushCount + _sbUI.FlushCount, World.Player == null ? string.Empty : World.Player.Position.ToString(), SceneManager.CurrentScene is GameScene gameScene && gameScene.SelectedObject != null ? gameScene.SelectedObject.ToString() : string.Empty, string.Empty);

            //_sb.ConcatFormat(FORMATTED_STRING, CurrentFPS, SceneManager.CurrentScene.RenderedObjectsCount, _sb3D.Calls, _sb3D.Merged, World.Player == null ? string.Empty : World.Player.Position.ToString(), SceneManager.CurrentScene is GameScene gameScene && gameScene.SelectedObject != null ? gameScene.SelectedObject.ToString() : string.Empty, string.Empty, _sb3D.FlushCount + _sbUI.FlushCount);
            _infoText.Text = _sb.ToString();
            _infoText.Draw(_sbUI, new Point(Window.ClientBounds.Width - 150, 20));
            _sbUI.End();
        }
コード例 #3
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            SpriteBatchGraph.Begin(
                SpriteSortMode.Deferred,
                BlendState.AlphaBlend,
                null, null, null, null,
                SCamera.Transform);

            Filemanager.Draw();

            SpriteBatchGraph.End();

            SpriteBatchUI.Begin();
            foreach (var btn in Buttons)
            {
                btn.Draw();
            }
            SpriteBatchUI.End();

            base.Draw(gameTime);
        }