Moving around in the world

I'm developing a platform-style game using Box2d and Cocos2d and having trouble figure out how to scoll the physical world.

Each game level spans multiple screens. I use a tile map to display the static objects on the map (ground, hills, etc). My Box2d world used edge shapes to outline the tiles.

When the screen scrolls to the right, I can move the tiles but I don't understand how to move the edge shapes. The edge shapes actually shouldn't move, because they are static and their positions in the world never change. But, how do I change my view into the Box2d world so that the edge shapes follow the tiles as the screen scrolls?

Thanks!
If the body is static they cannot be move. Use non-static body, or just create all your world in box2d and then render only the piece that you need.
This can be easily implemented using a sensor big as you camera view, everything that collide with the sensor have to be rendered, then simply move the sensor to move your camera view 🙂
Also you can use a joint the camera and player for a nice camera/player follower 😁
Thanks for the reply!

I think I just figured it out. This post helped: viewtopic.php?f=3&t=4017.

I have the debug draw feature turned on and, as I scroll the tiles, I can see the edges defined in the Box2d world separate from the tile images. So, I was trying to figure out how to get the edges to stay with the tiles. To do this, I believe I must modify the renderer for debug draw so that it can update the debug shapes on the screen with the correct current position in the world. I'll give this a try and update with my findings.

Original thread: https://box2d.org/forum/viewtopic.php?t=4710