RenderNodeManager
RenderNodeManager
Constructor
new RenderNodeManager(renderer)
Parameters
| name | type | optional | description |
|---|---|---|---|
| renderer | Phaser.Renderer.WebGL.WebGLRenderer | No | The renderer that owns this manager. |
Scope: static
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L101
Since: 4.0.0
Public Members
currentBatchDrawingContext
currentBatchDrawingContext: Phaser.Renderer.WebGL.DrawingContext
Description:
The drawing context of the current batch. This is stored here because the batch node is stateless.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L249
Since: 4.0.0
currentBatchNode
currentBatchNode: Phaser.Renderer.WebGL.RenderNodes.RenderNode
Description:
The RenderNode which is currently being filled. This is stored so that it can be completed when another type of render is run.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L237
Since: 4.0.0
currentDebugNode
currentDebugNode: DebugGraphNode
Description:
The current node in the debug graph. This is used when debug is enabled.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L280
debug
debug: boolean
Description:
Whether nodes should record their run method for debugging. This should be set via setDebug.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L260
Since: 4.0.0
debugGraph
debugGraph: DebugGraphNode
Description:
The debug graph of nodes that have been run. This is used when debug is enabled.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L271
maxParallelTextureUnits
maxParallelTextureUnits: number
Description:
The maximum number of texture units to use as choices in a batch. Batches can bind several textures and select one of them per instance, allowing for larger batches. However, some mobile devices degrade performance when using multiple texture units. So if the game config option autoMobileTextures is enabled and the device is not a desktop, this will be set to 1. Otherwise, it will be set to the renderer's maxTextures.
Some shaders may require more than one texture unit, so the actual limit on texture units per batch is maxTextures.
This value can be changed at runtime via setMaxParallelTextureUnits.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L119
Since: 4.0.0
renderer
renderer: Phaser.Renderer.WebGL.WebGLRenderer
Description:
The renderer that owns this manager.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L108
Since: 4.0.0
Public Methods
addNode
<instance> addNode(name, node)
Description:
Add a node to the manager.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| name | string | No | The name of the node. |
| node | Phaser.Renderer.WebGL.RenderNodes.RenderNode | No | The node to add. |
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L291
Since: 4.0.0
addNodeConstructor
<instance> addNodeConstructor(name, constructor)
Description:
Add a constructor for a node to the manager. This will allow the node to be constructed when getNode is called.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| name | string | No | The name of the node. |
| constructor | function | No | The constructor for the node. |
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L316
Since: 4.0.0
debugToString
<instance> debugToString()
Description:
Format the current debug graph as an indented string.
Returns: string - The formatted debug graph.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L544
Since: 4.0.0
finishBatch
<instance> finishBatch()
Description:
Finish rendering the current batch. This should be called when starting a new rendering task.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L425
Since: 4.0.0
getNode
<instance> getNode(name)
Description:
Get a node from the manager.
If the node does not exist, and a constructor is available, it will be constructed and added to the manager, then returned.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| name | string | No | The name of the node. |
Returns: Phaser.Renderer.WebGL.RenderNodes.RenderNode - The node, or null if it does not exist.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L335
Since: 4.0.0
hasNode
<instance> hasNode(name, [constructed])
Description:
Check if a node exists in the manager.
If a node is not constructed, but a constructor is available, it will be considered to exist. Set constructed to true to require that the node has already been constructed.
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| name | string | No | The name of the node. | |
| constructed | boolean | Yes | false | Whether the node must be constructed to be considered to exist. |
Returns: boolean - Whether the node exists.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L362
Since: 4.0.0
popDebug
<instance> popDebug()
Description:
Pop the last recorded RenderNode from the debug graph.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L521
Since: 4.0.0
pushDebug
<instance> pushDebug(name)
Description:
Record a newly run RenderNode in the debug graph.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| name | string | No | The name of the node. |
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L489
Since: 4.0.0
setCurrentBatchNode
<instance> setCurrentBatchNode(node, [drawingContext])
Description:
Set the current batch node. If a batch node is already in progress, it will be completed before the new node is set.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| node | Phaser.Renderer.WebGL.RenderNodes.BatchHandler | No | The node to set, or null to clear the current node. |
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | Yes | The drawing context. Only used if node is defined. |
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L380
Since: 4.0.0
setDebug
<instance> setDebug(value)
Description:
Set whether nodes should record their run method for debugging. This will set the debug property on all nodes, reset the debug graph, and record a single frame of the graph before disabling debug.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| value | boolean | No | Whether nodes should record their run method for debugging. |
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L452
Since: 4.0.0
setMaxParallelTextureUnits
<instance> setMaxParallelTextureUnits([value])
Description:
Set maxParallelTextureUnits to a new value. This will be clamped to the range [1, renderer.maxTextures].
This can be useful for providing the user with a way to adjust the performance of the game at runtime.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| value | number | Yes | The new value for maxParallelTextureUnits. Must be a number; it will be clamped to the range [1, renderer.maxTextures]. |
Fires: Phaser.Renderer.Events#event:SET_PARALLEL_TEXTURE_UNITS
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L406
Since: 4.0.0
startStandAloneRender
<instance> startStandAloneRender()
Description:
Start a standalone render (SAR), which is not part of a batch. This will trigger batch completion if a batch is in progress.
Source: src/renderer/webgl/renderNodes/RenderNodeManager.js#L440
Since: 4.0.0