Constructs a new Renderer instance
Renderer settings
Element ID or HTMLElement to insert the canvas into
Readonly
canvasPrivate
inspectorReadonly
rootReadonly
settingsReadonly
stageCreate a new Dynamic Shader controller
A Dynamic Shader is a shader that can be composed of an array of mulitple effects. Each effect can be animated or changed after creation (provided the effect is given a name).
Example:
renderer.createNode({
shader: renderer.createDynamicShader([
renderer.createEffect('radius', {
radius: 0
}, 'effect1'),
renderer.createEffect('border', {
color: 0xff00ffff,
width: 10,
}, 'effect2'),
]),
});
Create an effect to be used in a Dynamic Shader
Optional
name: NameThe {name} parameter is optional but required if you want to animate the effect or change the effect's properties after creation.
See createDynamicShader for an example.
Create a new scene graph node
A node is the main graphical building block of the Renderer scene graph. It can be a container for other nodes, or it can be a leaf node that renders a solid color, gradient, image, or specific texture, using a specific shader.
To create a text node, see createTextNode.
See CoreNode for more details.
Create a new shader controller for a shader type
Optional
props: ExtractProps<ShaderMap[ShType]>This method creates a new Shader Controller for a specific shader type.
If the shader has not been loaded yet, it will be loaded. Otherwise, the existing shader will be reused.
It can be assigned to a Node's shader
property.
Create a new scene graph text node
A text node is the second graphical building block of the Renderer scene graph. It renders text using a specific text renderer that is automatically chosen based on the font requested and what type of fonts are installed into an app.
See ITextNode for more details.
Create a new texture reference
This method creates a new reference to a texture. The texture is not loaded until it is used on a node.
It can be assigned to a node's texture
property, or it can be used
when creating a SubTexture.
Destroy a node
This method destroys a node
Generated using TypeDoc
The Renderer Main API
Remarks
This is the primary class used to configure and operate the Renderer.
It is used to create and destroy Nodes, as well as Texture and Shader references.
Example:
Events
fpsUpdate
fpsUpdateInterval
milliseconds with the current FPSframeTick
idle
criticalCleanup
memUsed
- The amount of memory (in bytes) used by textures before the cleanup processcriticalThreshold
- The critical threshold (in bytes)criticalCleanupFailed
memUsed
- The amount of memory (in bytes) used by textures after the cleanup processcriticalThreshold
- The critical threshold (in bytes)