LogoPixi’VN
pixi-jsFunctions

Function: generateTextureMatrix()

> generateTextureMatrix(out, style, shape, matrix?): Matrix

Defined in: node_modules/pixi.js/lib/scene/graphics/shared/utils/generateTextureFillMatrix.d.ts:23

Internal

Generates a texture matrix for mapping textures onto shapes. This function handles both local and global texture space mapping.

In local space, the texture is mapped to fit exactly within the bounds of the shape. In global space, the texture is mapped using its own dimensions and position.

Parameters

out

Matrix

The matrix to store the result in

style

FillStyle | StrokeStyle

The fill style containing texture and mapping properties

shape

ShapePrimitive

The shape to map the texture onto

matrix?

Matrix

Optional transform matrix to apply

Returns

Matrix

The generated texture matrix for UV mapping

Example

const matrix = new Matrix();
const textureMatrix = generateTextureMatrix(matrix, fillStyle, shape);
// textureMatrix now contains the proper UV mapping for the texture