コード例 #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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // Draw background physics map.
            ServerConsole.PhysicsWorld.DrawDebugOverlay(Camera);


            // Draw overlayed map components.
            DebugTools.BeginCustomDraw(DebugViewProjection, DebugViewTranslation);
            {
                foreach (var player in Player.AllPlayers)
                {
                    DebugDrawer.DrawDebugPlayer(DebugTools, player);
                }
            }
            DebugTools.EndCustomDraw();


            // Draw Text to debug pannel.
            DebugDrawer.BeginPanelText();
            {
                DebugDrawer.DrawPanelText("--------- Players ---------");
                foreach (var player in Player.AllPlayers)
                {
                    DebugDrawer.DrawPanelText(" ");
                    DebugDrawer.DrawPanelText(string.Format("Name:{0}", player.Name));
                    DebugDrawer.DrawPanelText(string.Format("Id:{0}", player.UniqueID));
                    DebugDrawer.DrawPanelText(string.Format("Position:{0}", player.Position));
                }
            }
            DebugDrawer.EndPanelText(DebugTools);



            // Outputs map text.
            DebugTools.RenderDebugData(DebugViewProjection, DebugViewTranslation);

            // Draw Xna base game.
            base.Draw(gameTime);
        }