PIXI.MeshMaterial
class MeshMaterial extends PIXI.Shader
Slightly opinionated default shader for PixiJS 2D objects.
Constructor
new PIXI.MeshMaterial(uSampler: PIXI.Texture, options: IMeshMaterialOptions) → {}
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
uSampler | PIXI.Texture |
Texture that material uses to render. |
||
options | IMeshMaterialOptions |
<optional> |
Additional options |
|
options.alpha | number |
<optional> |
1 |
Default alpha. |
options.tint | number |
<optional> |
0xFFFFFF |
Default tint. |
options.pluginName | string |
<optional> |
'batch' |
Renderer plugin for batching. |
options.program | PIXI.Program |
<optional> |
0xFFFFFF |
Custom program. |
options.uniforms | object |
<optional> |
Custom uniforms. |
Summary
Properties from MeshMaterial
number |
|
boolean |
|
string |
|
PIXI.Texture |
Reference to the texture being rendered. |
number |
|
PIXI.TextureMatrix |
|
Methods from MeshMaterial
void |
Gets called automatically by the Mesh. Intended to be overridden for custom MeshMaterial objects. |
void |
|
Properties inherited from Shader
PIXI.Program |
Program that the shader uses. |
Dict<any> |
|
Public Properties
batchable: boolean = true
true
if shader can be batch with the renderer's batch system.
uvMatrix: PIXI.TextureMatrix
TextureMatrix instance for this Mesh, used to track Texture changes.
Public Methods
update() → {void}
Gets called automatically by the Mesh. Intended to be overridden for custom MeshMaterial objects.
Type | Description |
---|---|
void |
Protected Methods
protected render(renderer: PIXI.CanvasRenderer, mesh: PIXI.Mesh) → {void}
Renders the mesh using the Canvas renderer
Name | Type | Description |
---|---|---|
renderer | PIXI.CanvasRenderer |
The canvas renderer. |
mesh | PIXI.Mesh |
Mesh to render. |
Type | Description |
---|---|
void |