FillCamera
A RenderNode that fills the viewport of a camera with a solid color, used to render a camera's background color before any game objects are drawn.
This node is invoked during the WebGL render pipeline whenever a camera has a background color set. It delegates the actual drawing to the FillRect RenderNode, which means the fill is submitted as a batched quad rather than a standalone draw call, keeping it efficient.
For cameras that render to a framebuffer (render textures), the camera's screen position is ignored and the fill is drawn at the origin of the framebuffer instead, since the framebuffer itself will be composited into the main scene at the correct position.
Constructor
new FillCamera(manager)
Parameters
| name | type | optional | description |
|---|---|---|---|
| manager | Phaser.Renderer.WebGL.RenderNodes.RenderNodeManager | No | The manager that owns this RenderNode. |
Scope: static
Extends
Source: src/renderer/webgl/renderNodes/FillCamera.js#L10
Since: 4.0.0
Inherited Members
From Phaser.Renderer.WebGL.RenderNodes.RenderNode:
Public Members
fillRectNode
fillRectNode: Phaser.Renderer.WebGL.RenderNodes.FillRect
Description:
The RenderNode that draws a filled rectangle.
Source: src/renderer/webgl/renderNodes/FillCamera.js#L39
Since: 4.0.0
Inherited Methods
From Phaser.Renderer.WebGL.RenderNodes.RenderNode:
Public Methods
run
<instance> run(drawingContext, color, [isFramebufferCamera])
Description:
Fills the camera with a color. This uses FillRect, so it is batched with other quads.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The context currently in use. |
| color | number | No | The color to fill the camera with. |
| isFramebufferCamera | boolean | Yes | Is this camera rendering to a framebuffer? If so, the camera position will not be applied, on the assumption that the camera position will be used to position the framebuffer in the external context. |
Overrides: Phaser.Renderer.WebGL.RenderNodes.RenderNode#run
Source: src/renderer/webgl/renderNodes/FillCamera.js#L49
Since: 4.0.0