Skip to main content
Version: Phaser v4.0.0

BatchHandlerStrip

This RenderNode renders textured triangle strips, such as for the Rope Game Object. It uses batches to accelerate drawing.

If a strip is submitted with too many vertices (usually >32,768), it will throw an error.

Note that you should call batchStrip instead of batch to add strips.

Constructor

new BatchHandlerStrip(manager, config)

Parameters

nametypeoptionaldescription
managerPhaser.Renderer.WebGL.RenderNodes.RenderNodeManagerNoThe manager that owns this RenderNode.
configPhaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerConfigNoThe configuration object for this handler.

Scope: static

Extends

Phaser.Renderer.WebGL.RenderNodes.BatchHandlerQuad

Source: src/renderer/webgl/renderNodes/BatchHandlerStrip.js#L21
Since: 4.0.0

Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.BatchHandler:

From Phaser.Renderer.WebGL.RenderNodes.BatchHandlerQuad:

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Members

defaultConfig

defaultConfig: Phaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerConfig

Description:

The default configuration object for this handler. This is merged with the config object passed in the constructor.

Overrides: Phaser.Renderer.WebGL.RenderNodes.BatchHandlerQuad#defaultConfig

Source: src/renderer/webgl/renderNodes/BatchHandlerStrip.js#L50
Since: 4.0.0


Inherited Methods

From Phaser.Renderer.WebGL.RenderNodes.BatchHandler:

From Phaser.Renderer.WebGL.RenderNodes.BatchHandlerQuad:

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Methods

batchStrip

<instance> batchStrip(drawingContext, src, calcMatrix, glTexture, vertices, uv, colors, alphas, alpha, tintMode, renderOptions, [debugCallback])

Description:

Adds a textured triangle strip to the batch. Each pair of vertices in vertices forms one instance. The vertices are transformed by calcMatrix before being written into the vertex buffer.

When multiple strips are batched together, degenerate triangles are automatically inserted between them by repeating the last vertex of one strip and the first vertex of the next, ensuring correct rendering without a draw-call break.

If the incoming strip would overflow the current batch, the batch is flushed first. If the strip itself exceeds the maximum batch capacity, an error is thrown.

This method is named batchStrip rather than batch because its call signature differs from the standard batch handlers used by quad-based Game Objects.

Parameters:

nametypeoptionaldescription
drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe current drawing context.
srcPhaser.GameObjects.GameObjectNoThe Game Object being rendered.
calcMatrixPhaser.GameObjects.Components.TransformMatrixNoThe current transform matrix used to transform each vertex position into world space.
glTexturePhaser.Renderer.WebGL.Wrappers.WebGLTextureWrapperNoThe texture to render.
verticesFloat32ArrayNoThe local-space vertex positions of the strip, as a flat array of alternating x and y values.
uvFloat32ArrayNoThe normalized texture coordinates of the strip, as a flat array of alternating u and v values, matching the layout of vertices.
colorsUint32ArrayNoThe per-vertex packed tint color values for the strip.
alphasFloat32ArrayNoThe per-vertex alpha multiplier values for the strip.
alphanumberNoThe overall alpha multiplier applied on top of the per-vertex alpha values.
tintModePhaser.TintModesNoThe tint mode to use.
renderOptionsPhaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerQuadRenderOptionsNoOptional render features. Strip rendering uses a single texture slot and does not support additional multi-texturing. The smoothPixelArt option is supported; other options are ignored.
debugCallbackfunctionYesAn optional callback invoked after all vertices are processed, called in the context of src with three arguments: the source Game Object, the total vertex count, and a flat array of alternating x,y world-space positions for the transformed vertices.

Source: src/renderer/webgl/renderNodes/BatchHandlerStrip.js#L128
Since: 4.0.0