mirror of
https://github.com/wassname/phaser.git
synced 2026-08-17 11:23:42 +08:00
Camera culling
This commit is contained in:
+5
-1
@@ -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
@@ -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'])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user