Ejemplo n.º 1
0
 /// <summary>
 /// Ends the drawing of text for this frame.
 /// </summary>
 public static void EndPanelText(DebugViewXNA debugView)
 {
     for (var i = 0; i < _panelText.Count; i++)
     {
         debugView.DrawString((TextPanelTopLeftCorner + FontLineSpacing * i), _panelText[i]);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Draws player representation to screen.
        /// </summary>
        public static void DrawDebugPlayer(DebugViewXNA debugView, Player player)
        {
            // draw player circle
            debugView.DrawCircle(player.Position, 20, Color.Blue);

            // Draw facing direction
            var directionVector = new Vector2((float)Math.Cos(player.Rotation), (float)Math.Sin(player.Rotation));

            debugView.DrawArrow(player.Position, player.Position + directionVector * 50, 25, 25, true, Color.Blue);

            // Draw player text
            var fontPos = FontToMapPosition(player.Position) + new Vector2(20, -20);// + (debugView.)

            debugView.DrawString((fontPos - FontLineSpacing * 4), string.Format("Name:{0}", player.Name));
            debugView.DrawString((fontPos - FontLineSpacing * 3), string.Format("Id:{0}", player.UniqueID));
            debugView.DrawString((fontPos - FontLineSpacing * 2), string.Format("Position:{0}", player.Position));
        }
Ejemplo n.º 3
0
        public override void OnRender(GameTime gameTime)
        {
            base.OnRender(gameTime);

            if (_debugViewState)
            {
                float scale = (SceneManager.Instance.GetCurrentCamera().Parent.GetPosition().Z / 1024.0f);
                _projection = Matrix.CreateOrthographicOffCenter(
                    UnitsConverter.ToSimUnits(SceneManager.Instance.GetCurrentCamera().Parent.GetPosition().X - Platform.Instance.Device.Viewport.Width / 2f * scale),
                    UnitsConverter.ToSimUnits(SceneManager.Instance.GetCurrentCamera().Parent.GetPosition().X + Platform.Instance.Device.Viewport.Width / 2f * scale),
                    UnitsConverter.ToSimUnits(-SceneManager.Instance.GetCurrentCamera().Parent.GetPosition().Y + Platform.Instance.Device.Viewport.Height / 2f * scale),
                    UnitsConverter.ToSimUnits(-SceneManager.Instance.GetCurrentCamera().Parent.GetPosition().Y - Platform.Instance.Device.Viewport.Height / 2f * scale),
                    0f,
                    1f
                    );

                _debugView.DrawString(1, 1, "(R)eset, (F)reeze, (D)ebug to toggle debugview, Arrows to move.");
                _debugView.DrawString(1, 20, "(S) to spawn/unspawn, O,P to rotate.");
                _debugView.DrawString(1, 39, "Mouse:" + Mouse.GetState().X + ", " + Mouse.GetState().Y);
                _debugView.RenderDebugData(ref _projection, ref _view);
            }
        }
Ejemplo n.º 4
0
        public override void OnRender(GameTime gameTime)
        {
            base.OnRender(gameTime);

            if (_debugViewState)
            {
                float cameraPosition = UnitsConverter.ToSimUnits(_cameraPosition);
                _projection = Matrix.CreateOrthographicOffCenter(
                    cameraPosition - Platform.Instance.Device.Viewport.Width / 2f * 0.05f,
                    cameraPosition + Platform.Instance.Device.Viewport.Width / 2f * 0.05f,
                    Platform.Instance.Device.Viewport.Height * 0.05f,
                    0f,
                    0f,
                    1f
                    );

                _debugView.DrawString(1, 1, "(R)eset, (F)reeze, (D)ebug to toggle debugview, Arrows to move.");
                _debugView.DrawString(1, 20, "(S) to spawn/unspawn, O,P to rotate.");
                _debugView.DrawString(1, 39, "Mouse:" + Mouse.GetState().X + ", " + Mouse.GetState().Y);
                //_debugView.DrawString( 1, 26, "Speed: " + _robot.RobotPhysics.Speed );
                //_debugView.DrawString( 1, 51, "MaxSpeed:" + _robot.RobotPhysics.MaxAttainedSpeed );
                _debugView.RenderDebugData(ref _projection, ref _view);
            }
        }
Ejemplo n.º 5
0
 public void DrawTitle(int x, int y, string title)
 {
     DebugView.DrawString(x, y, title);
 }