W3cubDocs

/Phaser

Class: Phaser.Component.AutoCull

Constructor

new AutoCull()

The AutoCull Component is responsible for providing methods that check if a Game Object is within the bounds of the World Camera.
It is used by the InWorld component.

Source code: gameobjects/components/AutoCull.js (Line 13)

Public Properties

autoCull : boolean

A Game Object with autoCull set to true will check its bounds against the World Camera every frame.
If it is not intersecting the Camera bounds at any point then it has its renderable property set to false.
This keeps the Game Object alive and still processing updates, but forces it to skip the render step entirely.

This is a relatively expensive operation, especially if enabled on hundreds of Game Objects. So enable it only if you know it's required,
or you have tested performance and find it acceptable.

Source code: gameobjects/components/AutoCull.js (Line 28)

[readonly] inCamera : boolean

Checks if the Game Objects bounds intersect with the Game Camera bounds.
Returns true if they do, otherwise false if fully outside of the Cameras bounds.

Source code: gameobjects/components/AutoCull.js (Line 37)

© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.Component.AutoCull.html