- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
/**
* Generalized convenience utilities for Graphics.
* @namespace graphicsUtils
* @memberof PIXI
*/
import { buildPoly } from './buildPoly';
export { buildPoly };
import { buildCircle } from './buildCircle';
export { buildCircle };
import { buildRectangle } from './buildRectangle';
export { buildRectangle };
import { buildRoundedRectangle } from './buildRoundedRectangle';
export { buildRoundedRectangle };
export * from './buildLine';
export * from './ArcUtils';
export * from './BezierUtils';
export * from './QuadraticUtils';
export * from './BatchPart';
// for type only
import type { BatchPart } from './BatchPart';
import { SHAPES } from '@pixi/math';
import type { BatchDrawCall } from '@pixi/core';
import type { IShapeBuildCommand } from './IShapeBuildCommand';
/**
* Map of fill commands for each shape type.
* @memberof PIXI.graphicsUtils
* @member {object} FILL_COMMANDS
*/
export const FILL_COMMANDS: Record<SHAPES, IShapeBuildCommand> = {
[SHAPES.POLY]: buildPoly,
[SHAPES.CIRC]: buildCircle,
[SHAPES.ELIP]: buildCircle,
[SHAPES.RECT]: buildRectangle,
[SHAPES.RREC]: buildRoundedRectangle,
};
/**
* Batch pool, stores unused batches for preventing allocations.
* @memberof PIXI.graphicsUtils
* @member {Array<PIXI.graphicsUtils.BatchPart>} BATCH_POOL
*/
export const BATCH_POOL: Array<BatchPart> = [];
/**
* Draw call pool, stores unused draw calls for preventing allocations.
* @memberof PIXI.graphicsUtils
* @member {Array<PIXI.BatchDrawCall>} DRAW_CALL_POOL
*/
export const DRAW_CALL_POOL: Array<BatchDrawCall> = [];