Class: Renderer
Defined in: core/Renderer.ts:50
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:65
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:144
Get the background color.
Returns
Color
Set Signature
set backgroundColor(
color):void
Defined in: core/Renderer.ts:151
Set the background color.
Parameters
color
string | Color
Returns
void
Implementation of
backgroundOpacity
Get Signature
get backgroundOpacity():
number
Defined in: core/Renderer.ts:159
Get the background opacity (0 = fully transparent, 1 = fully opaque).
Returns
number
Set Signature
set backgroundOpacity(
value):void
Defined in: core/Renderer.ts:167
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:137
Get the current height.
Returns
number
Implementation of
isContextLost
Get Signature
get isContextLost():
boolean
Defined in: core/Renderer.ts:123
Whether the WebGL context is currently lost.
Returns
boolean
Implementation of
width
Get Signature
get width():
number
Defined in: core/Renderer.ts:130
Get the current width.
Returns
number
Implementation of
Methods
dispose()
dispose():
void
Defined in: core/Renderer.ts:220
Clean up resources. Removes canvas from DOM and disposes WebGL resources.
Returns
void
Implementation of
getCanvas()
getCanvas():
HTMLCanvasElement
Defined in: core/Renderer.ts:204
Get the underlying canvas element.
Returns
HTMLCanvasElement
The HTMLCanvasElement used for rendering
Implementation of
getThreeRenderer()
getThreeRenderer():
WebGLRenderer
Defined in: core/Renderer.ts:212
Get the underlying Three.js WebGLRenderer.
Returns
WebGLRenderer
The WebGLRenderer instance
Implementation of
render()
render(
scene,camera):void
Defined in: core/Renderer.ts:184
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:194
Handle resize events.
Parameters
width
number
New width in pixels
height
number
New height in pixels
Returns
void