Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I added the project "Farseer Physics Engine 3.3.1 HelloWorld XNA\DebugView XNA\DebugView XNA.csproj" to my solution explorer in Visual Studio. In addition, I added a reference to my project and the "using FarseerPhysics.DebugViews;" to my class.

But DebugView is still not working. I tried this code but I always get an error message and a warning. I found the code in a Farseer discussion:

Error message:

'FarseerPhysics.DebugViews.DebugViewXNA' does not contain a definition for 'DebugPanel' and no extension method 'DebugPanel' accepting a first argument of type 'FarseerPhysics.DebugViews.DebugViewXNA' could be found (are you missing a using directive or an assembly reference?)   


The referenced component 'DebugView XNA Content (Content)' could not be found.  

What is this DebugPanel? What is wrong?

What should I change in my code?


World world;
DebugViewXNA physicsDebug;
DebugViewXNA DebugViewFlags;
physicsDebug = new DebugViewXNA(world);
physicsDebug.DefaultShapeColor = Color.White;
physicsDebug.SleepingShapeColor = Color.LightGray;
physicsDebug.LoadContent(GraphicsDevice, Content);

Drawing DebugView:

 // calculate the projection and view adjustments for the debug view
        Matrix projection = Matrix.CreateOrthographicOffCenter(0f, graphics.GraphicsDevice.Viewport.Width / _displayUnitsToSimUnitsRatio,
                                                         graphics.GraphicsDevice.Viewport.Height / _displayUnitsToSimUnitsRatio, 0f, 0f,
        Matrix view = Matrix.CreateTranslation(new Vector3((_cameraPosition / _displayUnitsToSimUnitsRatio) - (_screenCenter / _displayUnitsToSimUnitsRatio), 0f)) * Matrix.CreateTranslation(new Vector3((_screenCenter / _displayUnitsToSimUnitsRatio), 0f));
        // draw the debug view
        physicsDebug.RenderDebugData(ref projection, ref view);
share|improve this question
Sounds like you didn't include the Debug Content project along with the Debug project. – Jon May 25 '13 at 11:23
What is the Debug Content project? How can I implement it? – Bryan May 25 '13 at 11:30
There is a DebugView Project, and a DebugView Content Project. Similar to other XNA projects, you have your Game and your Content. You should be able to add the DebugView Content Project. – Jon May 25 '13 at 11:46
I found a file named DebugViewXNA Content.contentproj in Farseer Physics Engine 3.3.1 HelloWorld XNA\DebugView XNA\Content Is that the correct file? I tried to add it to my solution explorer, but I got a few warnings after adding it to the solution explorer. What is wrong? How can I fix the other error message(DebugPanel)? – Bryan May 25 '13 at 16:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.