An Application plugin that automatically culls (hides) display objects that are outside
the visible screen area. This improves performance by not rendering objects that aren't visible.
Key Features:
Automatic culling based on screen boundaries
Configurable culling areas and behavior per container
// Create a container with culling enabled constcontainer=newContainer(); container.cullable =true; // Enable culling for this container container.cullableChildren =true; // Enable culling for children (default) app.stage.addChild(container);
// Optional: Set custom cull area to avoid expensive bounds calculations container.cullArea =newRectangle(0, 0, app.screen.width, app.screen.height);
// Add many sprites to the group for (let j =0; j <100; j++) { constsprite= Sprite.from('texture.png'); sprite.x = Math.random() *2000; sprite.y = Math.random() *2000;
sprite.cullable =true; // Enable culling for each sprite
// Set cullArea if needed // sprite.cullArea = new Rectangle(0, 0, 100, 100); // Optional
// Add to container container.addChild(sprite); }
Remarks
To enable culling, you must set the following properties on your containers:
cullable: Set to true to enable culling for the container
cullableChildren: Set to true to enable culling for children (default)
cullArea: Optional custom Rectangle for culling bounds
Performance Tips:
Group objects that are spatially related
Use cullArea for containers with many children to avoid bounds calculations
Set cullableChildren = false for containers that are always fully visible
An Application plugin that automatically culls (hides) display objects that are outside the visible screen area. This improves performance by not rendering objects that aren't visible.
Key Features:
Example
Remarks
To enable culling, you must set the following properties on your containers:
cullable
: Set totrue
to enable culling for the containercullableChildren
: Set totrue
to enable culling for children (default)cullArea
: Optional custom Rectangle for culling boundsPerformance Tips:
cullArea
for containers with many children to avoid bounds calculationscullableChildren = false
for containers that are always fully visibleSee