This project has moved. For the latest updates, please go here.

PhysicsSimulatorVIEW draw-offset?

May 8, 2010 at 11:02 AM
Edited May 12, 2010 at 12:33 PM

Hi there.

Is is possible to give the PhysicsSimulatorView (not the PhysicsSimulator) a draw-offset?

For example, when my character walks outside the screen boundaries on the right, the entire map scrolls left. But I found no way to scroll the PhysicsSimulatorView. The edgeViews are no longer matching the texture-boundaries when the camera is anything but a Vector2.Zero.

May 10, 2010 at 4:35 PM

The physical entities shouldn't scroll with the graphics.  Drawing should be handled separately from the physics simulation.  Do your scrolling in the Draw code like so...

sb.Draw(..., myBody.Position - cameraPos, ...);

May 11, 2010 at 12:10 PM
Edited May 11, 2010 at 12:12 PM

Thanks for replying Yota. But I use a camera for the scrolling of my entities.... Ah wait I see the misunderstanding. I meant the PhysicsSimulatorView and NOT the PhysicsSimulator. I just want the debug-view with the edges and joints and stuff to scroll too. I updated my first post to correct this mistake :P.