PIXI.TextureMatrix

class TextureMatrix

Class controls uv mapping from Texture normal space to BaseTexture normal space.

Takes trim and rotate into account. May contain clamp settings for Meshes and TilingSprite.

Can be used in Texture uvMatrix field, or separately, you can use different clamp settings on the same texture. If you want to add support for texture region of certain feature or filter, that's what you're looking for.

Takes track of Texture changes through _lastTextureID private field. Use update() method call to track it from outside.

See:

Constructor


new PIXI.TextureMatrix(texture: PIXI.Texture, clampMargin: number) → {}
Parameters:
Name Type Attributes Description
texture PIXI.Texture

observed texture

clampMargin number

<optional>

Changes frame clamping, 0.5 by default. Use -0.5 for extra border.

Summary


Properties from TextureMatrix

number
clampMargin = 0.5
number
clampOffset = 0
boolean
isSimple = false
PIXI.Matrix
mapCoord
PIXI.Texture
texture

Texture property.

Float32Array
uClampFrame
Float32Array
uClampOffset

Normalized clamp offset. Calculated based on clampOffset.

number
protected _textureID
number
protected _updateID

Public Properties


clampMargin TextureMatrix.ts:38
clampMargin: number = 0.5

Changes frame clamping Works with TilingSprite and Mesh Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas

clampOffset TextureMatrix.ts:30
clampOffset: number = 0

Changes frame clamping Works with TilingSprite and Mesh Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders

isSimple TextureMatrix.ts:68
isSimple: boolean = false

If texture size is the same as baseTexture.

mapCoord TextureMatrix.ts:24
mapCoord: PIXI.Matrix

Matrix operation that converts texture region coords to texture coords

texture TextureMatrix.ts:94
texture: PIXI.Texture

Texture property.

uClampFrame TextureMatrix.ts:46
uClampFrame: Float32Array

Clamp region for normalized coords, left-top pixel center in xy , bottom-right in zw. Calculated based on clampOffset.

uClampOffset TextureMatrix.ts:52
uClampOffset: Float32Array

Normalized clamp offset. Calculated based on clampOffset.

Protected Properties


_textureID TextureMatrix.ts:55
protected _textureID: number

Tracks Texture frame changes.

_updateID TextureMatrix.ts:61
protected _updateID: number

Tracks Texture frame changes.

Public Methods


multiplyUvs TextureMatrix.ts:106
multiplyUvs(uvs: Float32Array, out: Float32Array) → {Float32Array}

Multiplies uvs array to transform

Parameters:
Name Type Attributes Default Description
uvs Float32Array

mesh uvs

out Float32Array

<optional>

uvs

output

Returns:
Type Description
Float32Array
  • output
update TextureMatrix.ts:133
update(forceUpdate: boolean) → {boolean}

Updates matrices if texture was changed.

Parameters:
Name Type Attributes Default Description
forceUpdate boolean

<optional>

false

if true, matrices will be updated any case

Returns:
Type Description
boolean
  • Whether or not it was updated

Powered by webdoc!