Camera culling

This commit is contained in:
Richard Davey
2013-09-01 19:52:50 +01:00
parent 7bdcbf5c2a
commit d31777972c
8 changed files with 188 additions and 65 deletions
+5 -1
View File
@@ -14,7 +14,9 @@ Phaser.Camera = function (game, id, x, y, width, height) {
// The view into the world we wish to render (by default the game dimensions)
// The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render
// Objects outside of this view are not rendered (unless set to ignore the Camera, i.e. UI?)
this.view = new Phaser.Rectangle(x, y, width, height);
this.view = new Phaser.Rectangle(x, y, width, height);
this.screenView = new Phaser.Rectangle(x, y, width, height);
};
@@ -116,6 +118,8 @@ Phaser.Camera.prototype = {
// this.plugins.preUpdate();
// Add dirty flag
if (this.target !== null)
{
if (this.deadzone == null)
+5 -5
View File
@@ -59,11 +59,11 @@ Phaser.World.prototype = {
do
{
if (!displayObject.visible)
{
displayObject = displayObject.last._iNext;
continue;
}
// if (!displayObject.active)
// {
// displayObject = displayObject.last._iNext;
// continue;
// }
if (displayObject['update'])
{