Skip to main content

OverlayInterface

Defined in: livelink.js/sources/rendering/surfaces/OverlayInterface.ts:12

Interface for rendering overlays.

An overlay is a surface that is drawn on top of the main rendering surface, and composited with the frame rendered by the server.

See

For a Three.js overlay implementation, see: https://www.npmjs.com/package/@3dverse/livelink-three

Methods

draw()

draw(params: {
output_canvas: null | OffscreenCanvas;
}): null | OffscreenCanvas

Defined in: livelink.js/sources/rendering/surfaces/OverlayInterface.ts:22

Draws the overlay to the output canvas if provided. If no output canvas is provided, the overlay should use its own way to render itself.

Parameters

ParameterTypeDescription
params{ output_canvas: null | OffscreenCanvas; }
params.output_canvasnull | OffscreenCanvasThe optional canvas to draw the overlay to.

Returns

null | OffscreenCanvas

The optional canvas containing the overlay.


resize()

resize(__namedParameters: {
width: number;
height: number;
}): void

Defined in: livelink.js/sources/rendering/surfaces/OverlayInterface.ts:27

Resizes the overlay.

Parameters

ParameterType
__namedParameters{ width: number; height: number; }
__namedParameters.widthnumber
__namedParameters.heightnumber

Returns

void


release()

release(): void

Defined in: livelink.js/sources/rendering/surfaces/OverlayInterface.ts:32

Releases the resources associated with the overlay.

Returns

void