Search Docs
Loading...
Skip to content

Interface: FrameSurface

The slice of the engine a canvas may touch, satisfied by the raw native binding.

Methods#

requestFrame()#

requestFrame(
width,
height,
pixelRatio?): void;

Size the camera to the host surface and ask for one frame. Does not tick the engine, and does nothing while a video export runs.

Parameters#

Parameter Type
width number
height number
pixelRatio? number

Returns#

void


getFrameInfo()#

getFrameInfo(): FrameInfo;

Cheap, synchronous, side-effect free.

Returns#

FrameInfo

readFrame()#

readFrame(target): boolean;

Fill target with the frame as top-left-origin RGBA8; false unless it is exactly width * height * 4 bytes, or while a video export runs.

Parameters#

Parameter Type
target Uint8Array

Returns#

boolean


sendMouseMove()#

sendMouseMove(
x,
y,
timestamp?): void;

Forward a pointer move, in the surface pixels readFrame hands back.

Parameters#

Parameter Type
x number
y number
timestamp? number

Returns#

void


sendMouseButton()#

sendMouseButton(
x,
y,
button,
down,
modifiers?,
timestamp?): void;

Forward a button press or release at a surface pixel.

Parameters#

Parameter Type
x number
y number
button MouseButton
down boolean
modifiers? InputModifiers
timestamp? number

Returns#

void


mouseWheel()#

mouseWheel(
deltaX,
deltaY,
x?,
y?,
modifiers?): boolean;

Forward a wheel turn in surface pixels. The engine pans, or zooms while command is held.

Parameters#

Parameter Type
deltaX number
deltaY number
x? number
y? number
modifiers? InputModifiers

Returns#

boolean


sendKey()#

sendKey(
key,
characters?,
modifiers?,
timestamp?): void;

Forward a key, spelled as DOM KeyboardEvent.key (‘ArrowLeft’, ‘a’).

Parameters#

Parameter Type
key string
characters? string
modifiers? InputModifiers
timestamp? number

Returns#

void