Class: WebGLRenderer

WebGLRenderer

The default WebGL renderer, uses WebGL2 contexts.

Extends

Implements

Inherited Properties

From class AbstractRenderer

_roundPixels 0 | 1 inherited

canvas CANVAS inherited

The canvas element that everything is drawn to.

height number inherited

Same as view.height, actual number of pixels in the canvas by vertical.

Default Value:
  • 600

lastObjectRendered Container readonly inherited

the last object rendered by the renderer. Useful for other plugins like interaction managers

renderingToScreen boolean readonly inherited

Flag if we are rendering to the screen vs renderTexture

Default Value:
  • true

resolution number inherited overrides

Default resolution / device pixel ratio of the renderer.

Default Value:
  • 1

roundPixels boolean inherited

Whether the renderer will round coordinates to whole pixels when rendering. Can be overridden on a per scene item basis.

screen Rectangle inherited

Measurements of the screen. (0, 0, screenWidth, screenHeight).

Its safe to use as filterArea or hitArea for the whole stage.

width number readonly inherited

Same as view.width, actual number of pixels in the canvas by horizontal.

Default Value:
  • 800

Inherited Methods

From class AbstractRenderer

generateTexture (options) Texture Deprecated`` : since 8.0.0 inherited

Name Type Description
options GenerateTextureOptions | Container

options or container target to use when generating the texture

Returns:
Type Description
Texture a texture

init (options) inherited

Initialize the renderer.

Name Type Description
options Partial<OPTIONS>

The options to use to create the renderer.

render (args, deprecated) void Deprecated`` : since 8.0.0 inherited

Name Type Attributes Description
args RenderOptions | Container
deprecated {
   renderTexture: any
}
<optional>

render (options) void inherited

Renders the object to its view.

Name Type Attributes Description
options RenderOptions | Container

The options to render with.

options.container

The container to render.

options.target <optional>

The target to render to.

resize (desiredScreenWidth, desiredScreenHeight, resolution) void inherited

Resizes the WebGL view to the specified width and height.

Name Type Attributes Description
desiredScreenWidth number

The desired width of the screen.

desiredScreenHeight number

The desired height of the screen.

resolution number <optional>

The resolution / device pixel ratio of the renderer.