Class: Renderer
Defined in: core/Renderer.ts:51
Three.js WebGLRenderer wrapper for manimweb. Handles canvas creation, rendering, and lifecycle management.
Implements
Constructors
Constructor
new Renderer(
container,options):Renderer
Defined in: core/Renderer.ts:69
Create a new Renderer and append it to the container.
Parameters
container
HTMLElement
DOM element to append the canvas to
options
RendererOptions = {}
Renderer configuration options
Returns
Renderer
Accessors
backgroundColor
Get Signature
get backgroundColor():
Color
Defined in: core/Renderer.ts:149
Get the background color.
Returns
Color
Set Signature
set backgroundColor(
color):void
Defined in: core/Renderer.ts:156
Set the background color.
Parameters
color
string | Color
Returns
void
Implementation of
backgroundOpacity
Get Signature
get backgroundOpacity():
number
Defined in: core/Renderer.ts:164
Get the background opacity (0 = fully transparent, 1 = fully opaque).
Returns
number
Set Signature
set backgroundOpacity(
value):void
Defined in: core/Renderer.ts:172
Set the background opacity (0 = fully transparent, 1 = fully opaque). Only effective if the scene was created with backgroundOpacity < 1 or alpha enabled.
Parameters
value
number
Returns
void
Implementation of
height
Get Signature
get height():
number
Defined in: core/Renderer.ts:142
Get the current height.
Returns
number
Implementation of
isContextLost
Get Signature
get isContextLost():
boolean
Defined in: core/Renderer.ts:128
Whether the WebGL context is currently lost.
Returns
boolean
Implementation of
width
Get Signature
get width():
number
Defined in: core/Renderer.ts:135
Get the current width.
Returns
number
Implementation of
Methods
dispose()
dispose():
void
Defined in: core/Renderer.ts:232
Clean up resources. Removes canvas from DOM and disposes WebGL resources.
Returns
void
Implementation of
getCanvas()
getCanvas():
HTMLCanvasElement
Defined in: core/Renderer.ts:216
Get the underlying canvas element.
Returns
HTMLCanvasElement
The HTMLCanvasElement used for rendering
Implementation of
getThreeRenderer()
getThreeRenderer():
WebGLRenderer
Defined in: core/Renderer.ts:224
Get the underlying Three.js WebGLRenderer.
Returns
WebGLRenderer
The WebGLRenderer instance
Implementation of
render()
render(
scene,camera):void
Defined in: core/Renderer.ts:189
Render a frame.
Parameters
scene
Scene
Three.js scene to render
camera
Camera
Three.js camera to use
Returns
void
Implementation of
resize()
resize(
width,height):void
Defined in: core/Renderer.ts:201
Handle resize events. Re-applies the device pixel ratio so DPR changes (e.g. screen rotation moving the canvas between displays) do not leave a blurry buffer.
Parameters
width
number
New width in pixels
height
number
New height in pixels
Returns
void