LogoPixi’VN
pixi-jsClasses

Class: PoolGroupClass

Defined in: node_modules/pixi.js/lib/utils/pool/PoolGroup.d.ts:15

A group of pools that can be used to store objects of different types.

Advanced

Constructors

Constructor

> new PoolGroupClass(): PoolGroupClass

Returns

PoolGroupClass

Methods

clear()

> clear(): void

Defined in: node_modules/pixi.js/lib/utils/pool/PoolGroup.d.ts:55

Clears all pools in the group. This will reset all pools and free their resources.

Returns

void


get()

> get<T>(Class, data?): T

Defined in: node_modules/pixi.js/lib/utils/pool/PoolGroup.d.ts:35

Gets an item from a specific pool.

Type Parameters

T

T extends PoolItem

The type of items in the pool. Must extend PoolItem.

Parameters

Class

PoolItemConstructor<T>

The constructor of the items in the pool.

data?

unknown

Optional data to pass to the item's constructor.

Returns

T

The item from the pool.


getPool()

> getPool<T>(ClassType): Pool<T>

Defined in: node_modules/pixi.js/lib/utils/pool/PoolGroup.d.ts:47

Gets a specific pool based on the class type.

Type Parameters

T

T extends PoolItem

The type of items in the pool. Must extend PoolItem.

Parameters

ClassType

PoolItemConstructor<T>

The constructor of the items in the pool.

Returns

Pool<T>

The pool of the given class type.


prepopulate()

> prepopulate<T>(Class, total): void

Defined in: node_modules/pixi.js/lib/utils/pool/PoolGroup.d.ts:27

Prepopulates a specific pool with a given number of items.

Type Parameters

T

T extends PoolItem

The type of items in the pool. Must extend PoolItem.

Parameters

Class

PoolItemConstructor<T>

The constructor of the items in the pool.

total

number

The number of items to add to the pool.

Returns

void


return()

> return(item): void

Defined in: node_modules/pixi.js/lib/utils/pool/PoolGroup.d.ts:40

Returns an item to its respective pool.

Parameters

item

PoolItem

The item to return to the pool.

Returns

void


stats()

> stats(): Record<string, { free: number; size: number; used: number; }>

Defined in: node_modules/pixi.js/lib/utils/pool/PoolGroup.d.ts:49

gets the usage stats of each pool in the system

Returns

Record<string, { free: number; size: number; used: number; }>