Phaser API Documentation

  Version: 
<nullable> viewBounds: Phaser.Geom.Rectangle

Description:

An optional Rectangle object that is used during rendering to cull Particles from display. For example, if your particles are limited to only move within a 300x300 sized area from their origin, then you can set this Rectangle to those dimensions.

The renderer will check to see if the viewBounds Rectangle intersects with the Camera bounds during the render step and if not it will skip rendering the Emitter entirely.

This allows you to create many emitters in a Scene without the cost of rendering if the contents aren't visible.

Note that the Emitter will not perform any checks to see if the Particles themselves are outside of these bounds, or not. It will simply check the bounds against the camera. Use the getBounds method with the advance parameter to help define the location and placement of the view bounds.

Default: null
Since: 3.60.0