cykod/Quintus — pull request #50 by fariazz (2013-08-04 20:53:49+00:00)
Title: optional bounding box to the viewport to restrict camera to an area

when adding the viewport to the player, you can new specify a bounding box so that the camera doesn't go outside of this box.

For example if you want to restrict the camera to the level, so that no areas outside the level are shown:

```
Q.scene("level1",function(stage) {

var background = new Q.TileLayer({ dataAsset: 'level1.tmx', layerIndex: 0, sheet: 'tiles', tileW: 70, tileH: 70, type: Q.SPRITE_NONE });
stage.insert(background);
console.log(background);

stage.collisionLayer(new Q.TileLayer({ dataAsset: 'level1.tmx', layerIndex:1, sheet: 'tiles', tileW: 70, tileH: 70 }));

var player = stage.insert(new Q.Player());

stage.add("viewport").follow(player,{x: true, y: true},{minX: 0, maxX: background.p.w, minY: 0, maxY: background.p.h});

});

```

See it in action here: http://static.pablofarias.com/boundingbox/