Box2D scrolling?

BlitzMax Forums/Brucey's Modules/Box2D scrolling?

neos300(Posted 2010) [#1]
Does Box2D (or chipmunk or farseer) support sidescrolling by default? If they don't, could anyone please point me in a direction that will help me with sidescrolling?


ima747(Posted 2010) [#2]
Without knowing more I am going to assume that what you need is to disconnect your screen positions from your physics positions. Try creating a screen offset variable that you add to any drawing positions, you can then change that offset to make things draw shifted by the offset value. Think of physics positions as real positions and drawing positions as points relative to the "camera".


neos300(Posted 2010) [#3]
Ah, thank you.


Robert Cummings(Posted 2010) [#4]
Yes that is how it's done. The physics world does not move, but your offset drawing positions do.