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.
Constructor
new PIXI.TextureMatrix(texture: PIXI.Texture, clampMargin: number) → {}
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 |
|
number |
|
boolean |
|
PIXI.Matrix |
|
PIXI.Texture |
Texture property. |
Float32Array |
|
Float32Array |
Normalized clamp offset. Calculated based on clampOffset. |
number |
|
number |
|
Methods from TextureMatrix
Float32Array |
|
boolean |
|
Public Properties
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: 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
mapCoord: PIXI.Matrix
Matrix operation that converts texture region coords to texture coords
uClampFrame: Float32Array
Clamp region for normalized coords, left-top pixel center in xy , bottom-right in zw. Calculated based on clampOffset.
uClampOffset: Float32Array
Normalized clamp offset. Calculated based on clampOffset.
Protected Properties
Public Methods
multiplyUvs(uvs: Float32Array, out: Float32Array) → {Float32Array}
Multiplies uvs array to transform
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
uvs | Float32Array |
mesh uvs |
||
out | Float32Array |
<optional> |
uvs |
output |
Type | Description |
---|---|
Float32Array |
|
update(forceUpdate: boolean) → {boolean}
Updates matrices if texture was changed.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
forceUpdate | boolean |
<optional> |
false |
if true, matrices will be updated any case |
Type | Description |
---|---|
boolean |
|