We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 268b133 commit ae663f9Copy full SHA for ae663f9
1 file changed
src/gameobjects/components/InWorld.js
@@ -40,6 +40,12 @@ Phaser.Component.InWorld.preUpdate = function () {
40
else
41
{
42
this.renderable = false;
43
+
44
+ if (this.outOfCameraBoundsKill)
45
+ {
46
+ this.kill();
47
+ return false;
48
+ }
49
}
50
51
@@ -99,6 +105,15 @@ Phaser.Component.InWorld.prototype = {
99
105
*/
100
106
outOfBoundsKill: false,
101
107
108
+ /**
109
+ * If this and the `autoCull` property are both set to `true`, then the `kill` method
110
+ * is called as soon as the Game Object leaves the camera bounds.
111
+ *
112
+ * @property {boolean} outOfCameraBoundsKill
113
+ * @default
114
+ */
115
+ outOfCameraBoundsKill: false,
116
102
117
/**
103
118
* @property {boolean} _outOfBoundsFired - Internal state var.
104
119
* @private
0 commit comments