@univerjs/engine-render v0.5.4


Class: Engine

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:40

Extends

Constructors

new Engine()

new Engine(): Engine

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:151

Returns

Engine

Overrides

Disposable.constructor

new Engine()

new Engine(unitId, options?): Engine

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:152

Parameters

ParameterType
unitIdstring
options?IEngineOption

Returns

Engine

Overrides

Disposable.constructor

new Engine()

new Engine(
   elemW, 
   elemH, 
   dpr?, 
   renderMode?): Engine

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:153

Parameters

ParameterType
elemWnumber
elemHnumber
dpr?number
renderMode?CanvasRenderMode

Returns

Engine

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_disposedprotectedbooleanfalse-Disposable._disposedpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96
beginFrame$readonlyObservable<number>undefined--packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:44
endFrame$readonlyObservable<IBasicFrameInfo>undefined--packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:46
onInputChanged$publicEventSubject<IEvent>undefinedPass event to scene.input-manager-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:54
onTransformChange$publicEventSubject<ITransformChangeState>undefined--packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:56
renderEvenInBackgroundpublicbooleantrue--packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:41
renderFrameTags$readonlySubject<[string, any]>undefined--packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:49
renderFrameTimeMetric$readonlySubject<ITimeMetric>undefined--packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:48

Accessors

activeScene

Get Signature

get activeScene(): null | Scene

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:220

Returns

null | Scene


classType

Get Signature

get classType(): RENDER_CLASS_TYPE

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:216

Returns

RENDER_CLASS_TYPE


clientRect$

Get Signature

get clientRect$(): Observable<void>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:69

Returns

Observable<void>


elapsedTime

Get Signature

get elapsedTime(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:204

Returns

number


frameId

Get Signature

get frameId(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:264

Gets the current frame id

Returns

number


height

Get Signature

get height(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:212

Returns

number


requestNewFrameHandler

Get Signature

get requestNewFrameHandler(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:257

Returns

number


unitId

Get Signature

get unitId(): string

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:200

Returns

string


width

Get Signature

get width(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:208

Returns

number

Methods

_beginFrame()

_beginFrame(_timestamp): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:488

Begin a new frame

Parameters

ParameterType
_timestampnumber

Returns

void


_endFrame()

_endFrame(timestamp): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:496

End the current frame

Parameters

ParameterType
timestampnumber

Returns

void


_init()

_init(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:196

Returns

void


addFunction2RenderLoop()

addFunction2RenderLoop(renderFunction): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:415

Parameters

ParameterType
renderFunction() => void

Returns

void


addScene()

addScene(sceneInstance): Scene

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:236

Parameters

ParameterType
sceneInstanceScene

Returns

Scene


clearCanvas()

clearCanvas(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:273

Returns

void


dispose()

dispose(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:376

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


dprChange()

dprChange(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:348

Returns

void


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


getCanvas()

getCanvas(): Canvas

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:277

Returns

Canvas


getCanvasElement()

getCanvasElement(): HTMLCanvasElement

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:281

Returns

HTMLCanvasElement


getDeltaTime()

getDeltaTime(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:519

Gets the time spent between current and previous frame

Returns

number

a number representing the delta time in ms


getFps()

getFps(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:511

Gets the current framerate

Returns

number

a number representing the framerate


getPixelRatio()

getPixelRatio(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:297

Returns

number


getScene()

getScene(sceneKey): null | Scene

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:228

Parameters

ParameterType
sceneKeystring

Returns

null | Scene


getScenes()

getScenes(): {}

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:224

Returns

{}

hasActiveScene()

hasActiveScene(): boolean

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:253

Returns

boolean


hasScene()

hasScene(sceneKey): boolean

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:232

Parameters

ParameterType
sceneKeystring

Returns

boolean


resize()

resize(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:333

Returns

void


resizeBySize()

resizeBySize(width, height): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:359

set canvas element size

Parameters

ParameterType
widthnumber
heightnumber

Returns

void


runRenderLoop()

runRenderLoop(renderFunction): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:434

Register and execute a render loop. The engine could manage more than one render function

Parameters

ParameterTypeDescription
renderFunction() => voiddefines the function to continuously execute

Returns

void


setActiveScene()

setActiveScene(sceneKey): null | Scene

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:245

Parameters

ParameterType
sceneKeystring

Returns

null | Scene


setCanvasCursor()

setCanvasCursor(val): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:268

Parameters

ParameterType
valCURSOR_TYPE

Returns

void


setCapture()

setCapture(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:289

To ensure mouse events remain bound to the host element, preventing the events from becoming ineffective once the mouse leaves the host.

Returns

void


setContainer()

setContainer(elem, resize): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:301

Parameters

ParameterTypeDefault value
elemHTMLElementundefined
resizebooleantrue

Returns

void


startRenderLoop()

startRenderLoop(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:421

Returns

void


stopRenderLoop()

stopRenderLoop(renderFunction?): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:468

stop executing a render loop function and remove it from the execution array

Parameters

ParameterTypeDescription
renderFunction?() => voiddefines the function to be removed. If not provided all functions will be removed.

Returns

void