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
| name | type | optional | description |
|---|---|---|---|
| manager | Phaser.Renderer.WebGL.RenderNodes.RenderNodeManager | No | The manager that owns this RenderNode. |
| config | Phaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerConfig | No | The configuration object for this handler. |
Scope: static
Extends
Source: src/renderer/webgl/renderNodes/BatchHandlerStrip.js#L21
Since: 4.0.0
Inherited Members
From Phaser.Renderer.WebGL.RenderNodes.BatchHandler:
- batchEntries
- bytesPerIndexPerInstance
- bytesPerInstance
- currentBatchEntry
- floatsPerInstance
- indexBuffer
- indicesPerInstance
- instanceCount
- instancesPerBatch
- maxTexturesPerBatch
- programManager
- vertexBufferLayout
- verticesPerInstance
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:
- batch
- batchTextures
- finalizeTextureCount
- pushCurrentBatchEntry
- run
- setupTextureUniforms
- setupUniforms
- updateRenderOptions
- updateShaderConfig
- updateTextureCount
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:
| name | type | optional | description |
|---|---|---|---|
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The current drawing context. |
| src | Phaser.GameObjects.GameObject | No | The Game Object being rendered. |
| calcMatrix | Phaser.GameObjects.Components.TransformMatrix | No | The current transform matrix used to transform each vertex position into world space. |
| glTexture | Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper | No | The texture to render. |
| vertices | Float32Array | No | The local-space vertex positions of the strip, as a flat array of alternating x and y values. |
| uv | Float32Array | No | The normalized texture coordinates of the strip, as a flat array of alternating u and v values, matching the layout of vertices. |
| colors | Uint32Array | No | The per-vertex packed tint color values for the strip. |
| alphas | Float32Array | No | The per-vertex alpha multiplier values for the strip. |
| alpha | number | No | The overall alpha multiplier applied on top of the per-vertex alpha values. |
| tintMode | Phaser.TintModes | No | The tint mode to use. |
| renderOptions | Phaser.Types.Renderer.WebGL.RenderNodes.BatchHandlerQuadRenderOptions | No | Optional 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. |
| debugCallback | function | Yes | An 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