A simple object pool supporting the most basic utility objects.

If you want to retrieve an object, but the pool does not contain any more instances, it will silently create a new one.

It's important that you use the pool in a balanced way, i.e. don't just "get" or "put" alone! Always make the calls in pairs; whenever you get an object, be sure to put it back later, and the other way round. Otherwise, the pool will empty or (even worse) grow in size uncontrolled.

### Hierarchy

- Pool

## Index

### Methods

- getMatrix
- getMatrix3D
- getPoint
- getPoint3D
- getRectangle
- putMatrix
- putMatrix3D
- putPoint
- putPoint3D
- putRectangle

## Methods

### Static getMatrix

- getMatrix(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number): Matrix

- - Defined in lib/starling/utils/Pool.d.ts:37

  Retrieves a Matrix instance from the pool.

  #### Parameters

  - ##### Optional a: number

  - ##### Optional b: number

  - ##### Optional c: number

  - ##### Optional d: number

  - ##### Optional tx: number

  - ##### Optional ty: number

  #### Returns Matrix

### Static getMatrix3D

- getMatrix3D(identity?: boolean): Matrix3D

- - Defined in lib/starling/utils/Pool.d.ts:49

  Retrieves a Matrix3D instance from the pool.

  @param identity If enabled, the matrix will be reset to the identity. Otherwise, its contents is undefined.

  #### Parameters

  - ##### Optional identity: boolean

  #### Returns Matrix3D

### Static getPoint

- getPoint(x?: number, y?: number): Point

- - Defined in lib/starling/utils/Pool.d.ts:23

  Retrieves a Point instance from the pool.

  #### Parameters

  - ##### Optional x: number

  - ##### Optional y: number

  #### Returns Point

### Static getPoint3D

- getPoint3D(x?: number, y?: number, z?: number): Vector3D

- - Defined in lib/starling/utils/Pool.d.ts:30

  Retrieves a Vector3D instance from the pool.

  #### Parameters

  - ##### Optional x: number

  - ##### Optional y: number

  - ##### Optional z: number

  #### Returns Vector3D

### Static getRectangle

- getRectangle(x?: number, y?: number, width?: number, height?: number): Rectangle

- - Defined in lib/starling/utils/Pool.d.ts:56

  Retrieves a Rectangle instance from the pool.

  #### Parameters

  - ##### Optional x: number

  - ##### Optional y: number

  - ##### Optional width: number

  - ##### Optional height: number

  #### Returns Rectangle

### Static putMatrix

- putMatrix(matrix: Matrix): void

- - Defined in lib/starling/utils/Pool.d.ts:42

  Stores a Matrix instance in the pool. Don't keep any references to the object after moving it to the pool!

  #### Parameters

  - ##### matrix: Matrix

  #### Returns void

### Static putMatrix3D

- putMatrix3D(matrix: Matrix3D): void

- - Defined in lib/starling/utils/Pool.d.ts:53

  Stores a Matrix3D instance in the pool. Don't keep any references to the object after moving it to the pool!

  #### Parameters

  - ##### matrix: Matrix3D

  #### Returns void

### Static putPoint

- putPoint(point: Point): void

- - Defined in lib/starling/utils/Pool.d.ts:27

  Stores a Point instance in the pool. Don't keep any references to the object after moving it to the pool!

  #### Parameters

  - ##### point: Point

  #### Returns void

### Static putPoint3D

- putPoint3D(point: Vector3D): void

- - Defined in lib/starling/utils/Pool.d.ts:34

  Stores a Vector3D instance in the pool. Don't keep any references to the object after moving it to the pool!

  #### Parameters

  - ##### point: Vector3D

  #### Returns void

### Static putRectangle

- putRectangle(rectangle: Rectangle): void

- - Defined in lib/starling/utils/Pool.d.ts:61

  Stores a Rectangle instance in the pool. Don't keep any references to the object after moving it to the pool!

  #### Parameters

  - ##### rectangle: Rectangle

  #### Returns void

Generated using TypeDoc