@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
Overrides
new Engine()
new Engine(unitId, options?): Engine
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:152
Parameters
Parameter | Type |
---|---|
unitId | string |
options ? | IEngineOption |
Returns
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
Parameter | Type |
---|---|
elemW | number |
elemH | number |
dpr ? | number |
renderMode ? | CanvasRenderMode |
Returns
Overrides
Disposable.constructor
Properties
Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
---|---|---|---|---|---|---|
_disposed | protected | boolean | false | - | Disposable ._disposed | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
beginFrame$ | readonly | Observable <number > | undefined | - | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:44 |
endFrame$ | readonly | Observable <IBasicFrameInfo > | undefined | - | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:46 |
onInputChanged$ | public | EventSubject <IEvent > | undefined | Pass event to scene.input-manager | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:54 |
onTransformChange$ | public | EventSubject <ITransformChangeState > | undefined | - | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:56 |
renderEvenInBackground | public | boolean | true | - | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:41 |
renderFrameTags$ | readonly | Subject <[string , any ]> | undefined | - | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:49 |
renderFrameTimeMetric$ | readonly | Subject <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
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
Parameter | Type |
---|---|
_timestamp | number |
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
Parameter | Type |
---|---|
timestamp | number |
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
Parameter | Type |
---|---|
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
Parameter | Type |
---|---|
sceneInstance | Scene |
Returns
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
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
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
getCanvas()
getCanvas(): Canvas
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:277
Returns
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
Parameter | Type |
---|---|
sceneKey | string |
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
Parameter | Type |
---|---|
sceneKey | string |
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
Parameter | Type |
---|---|
width | number |
height | number |
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
Parameter | Type | Description |
---|---|---|
renderFunction | () => void | defines 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
Parameter | Type |
---|---|
sceneKey | string |
Returns
null
| Scene
setCanvasCursor()
setCanvasCursor(val): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:268
Parameters
Parameter | Type |
---|---|
val | CURSOR_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
Parameter | Type | Default value |
---|---|---|
elem | HTMLElement | undefined |
resize | boolean | true |
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
Parameter | Type | Description |
---|---|---|
renderFunction ? | () => void | defines the function to be removed. If not provided all functions will be removed. |
Returns
void