LogoPixi’VN
pixi-jsInterfaces

Interface: BaseDestroyOptions

Defined in: node_modules/pixi.js/lib/scene/container/destroyTypes.d.ts:25

Base options for destroying display objects. Controls how deep the destruction process should go through the display tree.

Example

// Basic destruction - only this container
container.destroy({ children: false });

// Deep destruction - container and all children
container.destroy({ children: true });

// Cleanup pattern
function cleanupScene(scene: Container) {
    // Remove from parent first
    scene.parent?.removeChild(scene);
    // Then destroy with all children
    scene.destroy({ children: true });
}

See

Standard

Properties

children?

> optional children?: boolean

Defined in: node_modules/pixi.js/lib/scene/container/destroyTypes.d.ts:35

Whether to destroy children recursively. When true, runs destroy() on all children in the display tree.

Default

false

Example

container.destroy({ children: true });