PIXI.BatchPluginFactory

class BatchPluginFactory

Constructor


new PIXI.BatchPluginFactory() → {}

Summary


Properties from BatchPluginFactory

Methods from BatchPluginFactory

Public Properties


defaultFragmentTemplate BatchPluginFactory.ts:85
static defaultFragmentTemplate: string

The default fragment shader source

defaultVertexSrc BatchPluginFactory.ts:76
static defaultVertexSrc: string

The default vertex shader source

Public Methods


create BatchPluginFactory.ts:23
static create(options: object) → {unknown}

Create a new BatchRenderer plugin for Renderer. this convenience can provide an easy way to extend BatchRenderer with all the necessary pieces.


 const fragment = `
 varying vec2 vTextureCoord;
 varying vec4 vColor;
 varying float vTextureId;
 uniform sampler2D uSamplers[%count%];

 void main(void){
     vec4 color;
     %forloop%
     gl_FragColor = vColor * vec4(color.a - color.rgb, color.a);
 }
 `;
 const InvertBatchRenderer = PIXI.BatchPluginFactory.create({ fragment });
 PIXI.extensions.add({
  name: 'invert',
  ref: InvertBatchRenderer,
  type: PIXI.ExtensionType.RendererPlugin,
 });
 const sprite = new PIXI.Sprite();
 sprite.pluginName = 'invert';
Parameters:
Name Type Attributes Default Description
options object

<optional>

options.vertex string

<optional>

PIXI.BatchPluginFactory.defaultVertexSrc

Vertex shader source

options.fragment string

<optional>

PIXI.BatchPluginFactory.defaultFragmentTemplate

Fragment shader template

options.vertexSize number

<optional>

6

Vertex size

options.geometryClass object

<optional>

PIXI.BatchGeometry
Returns:
Type Description
unknown

New batch renderer plugin


Powered by webdoc!