Skip to main content

Interface: OverlayInterface

Defined in: livelink.clients/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

Properties​

PropertyModifierTypeDescription
container?readonlyHTMLElementOptional container element for the overlay.

Methods​

draw()​

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

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

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: OffscreenCanvas | null; }-
params.output_canvasOffscreenCanvas | nullThe optional canvas to draw the overlay to.

Returns​

OffscreenCanvas | null

The optional canvas containing the overlay.


resize()​

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

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

Resizes the overlay.

Parameters​

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

Returns​

void


release()​

release(): void;

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

Releases the resources associated with the overlay.

Returns​

void