Skip to content

Instantly share code, notes, and snippets.

@antonmills
Created July 6, 2013 10:33
Show Gist options
  • Select an option

  • Save antonmills/5939516 to your computer and use it in GitHub Desktop.

Select an option

Save antonmills/5939516 to your computer and use it in GitHub Desktop.
For scrolling a Box2D world. Remember, you've given Box2D a sprite to render to, all you need to do is offset that sprite.
_canvas.style.position = "absolute";
_canvas.style.left = "" + -(_car.GetWorldCenter().x * worldScale) + "px";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment