liabru/matter-js — pull request #31 by mrspeaker (2014-06-12 22:34:17+00:00)
Title: Implement view bounds for RenderPixi

To control the view port you need to have all sprites in a container, and the container can be moved. So I added a render.container that replaces render.stage where appropriate. I think this is pretty much the correct way to do things, and I need it for my current project - so feel free to close this off if it's not what you had in mind.

Also, for not drawing off-screen sprites in pixi you either need to manually add and remove the sprites - or you can set the `visible` flag. I've taken that approach:

body.render.sprite.visible = Bounds.overlaps(body.bounds, render.bounds);

This stops off-screen sprites being rendered, but it still goes through the grouping process in Render.body. I think that ok too though.