Skip to main content

VirtualSurface

@3dverse/livelink v0.8.10


@3dverse/livelink / VirtualSurface

Class: VirtualSurface

Defined in: livelink.js/sources/rendering/surfaces/VirtualSurface.ts:15

A virtual rendering surface.

A virtual surface is a surface that is not backed by a physical canvas. It is used to represent a surface that is not directly rendered to the screen.

Its main usecase is for video recording, where the frame rendered by the server is consumed as is and put directly into a video file.

Extends

Constructors

new VirtualSurface()

new VirtualSurface(__namedParameters): VirtualSurface

Defined in: livelink.js/sources/rendering/surfaces/VirtualSurface.ts:38

Creates a new virtual surface.

Parameters

__namedParameters
width

number

height

number

Returns

VirtualSurface

Overrides

RenderingSurfaceBase.constructor

Properties

viewports

readonly viewports: Viewport[] = []

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

List of viewports bound to the current surface.

Inherited from

RenderingSurfaceBase.viewports


offset

offset: Vec2

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

Offset of the surface relative to the remote rendering surface.

Inherited from

RenderingSurfaceBase.offset

Accessors

width

Get Signature

get width(): number

Defined in: livelink.js/sources/rendering/surfaces/VirtualSurface.ts:24

Width of the surface.

Returns

number

Overrides

RenderingSurfaceBase.width


height

Get Signature

get height(): number

Defined in: livelink.js/sources/rendering/surfaces/VirtualSurface.ts:31

Height of the surface.

Returns

number

Overrides

RenderingSurfaceBase.height

Methods

addViewport()

addViewport(params): void

Defined in: livelink.js/sources/rendering/surfaces/RenderingSurfaceBase.ts:67

Adds a viewport to the current surface.

Note that the viewport knows which section of the surface it should draw to using its Viewport.relative_rect property.

Parameters

params
viewport

Viewport

The viewport to add.

Returns

void

Inherited from

RenderingSurfaceBase.addViewport


removeViewport()

removeViewport(params): void

Defined in: livelink.js/sources/rendering/surfaces/RenderingSurfaceBase.ts:77

Removes a viewport from the current surface.

Parameters

params
viewport

Viewport

The viewport to remove.

Returns

void

Inherited from

RenderingSurfaceBase.removeViewport


release()

release(): void

Defined in: livelink.js/sources/rendering/surfaces/RenderingSurfaceBase.ts:87

Releases the resources associated with the current surface.

Returns

void

Inherited from

RenderingSurfaceBase.release


isValid()

isValid(): boolean

Defined in: livelink.js/sources/rendering/surfaces/RenderingSurfaceBase.ts:97

Returns whether the current surface is valid.

Returns

boolean

Inherited from

RenderingSurfaceBase.isValid


getBoundingRect()

getBoundingRect(): Rect

Defined in: livelink.js/sources/rendering/surfaces/VirtualSurface.ts:46

Returns the bounding rectangle of the surface.

Returns

Rect

Overrides

RenderingSurfaceBase.getBoundingRect


drawFrame()

drawFrame(): void

Defined in: livelink.js/sources/rendering/surfaces/VirtualSurface.ts:53

Do nothing.

Returns

void

Overrides

RenderingSurfaceBase.drawFrame


addEventListener()

addEventListener(type, callback, options?): void

Defined in: node_modules/typescript/lib/lib.dom.d.ts:8303

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Parameters

type

string

callback

null | EventListenerOrEventListenerObject

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

RenderingSurfaceBase.addEventListener


dispatchEvent()

dispatchEvent(event): boolean

Defined in: node_modules/typescript/lib/lib.dom.d.ts:8309

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

MDN Reference

Parameters

event

Event

Returns

boolean

Inherited from

RenderingSurfaceBase.dispatchEvent


removeEventListener()

removeEventListener(type, callback, options?): void

Defined in: node_modules/typescript/lib/lib.dom.d.ts:8315

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference

Parameters

type

string

callback

null | EventListenerOrEventListenerObject

options?

boolean | EventListenerOptions

Returns

void

Inherited from

RenderingSurfaceBase.removeEventListener