OptionalonCalled once per frame after all scenes are rendered.
OptionalonCalled once per frame before any scenes are rendered.
OptionalrendererProps forwarded to the underlying Renderer. autoClear is always
overridden to false.
Pass canvas here to use an existing <canvas> element instead of
letting the renderer create one. This is particularly useful in React,
where you can attach a ref to a <canvas> and pass the element in:
const canvasRef = useRef<HTMLCanvasElement>(null)
// inside useEffect:
new ScrollRenderer({ rendererProps: { canvas: canvasRef.current } })
When supplying your own canvas you are responsible for positioning it (fixed, full-viewport, pointer-events: none) and for removing it from the DOM on teardown.
Options passed to the ScrollRenderer constructor.