@univerjs/engine-render v0.5.0-beta.1 • Docs
Class: Engine
Extends
Constructors
new Engine()
new Engine(
elemWidth,
elemHeight,
pixelRatio?,
mode?): Engine
Parameters
Parameter | Type | Default value |
---|---|---|
elemWidth | number | 1 |
elemHeight | number | 1 |
pixelRatio ? | number | undefined |
mode ? | CanvasRenderMode | undefined |
Returns
Overrides
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:143
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
beginFrame$ | readonly | Observable <number > | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:37 |
endFrame$ | readonly | Observable <IBasicFrameInfo > | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:39 |
onInputChanged$ | public | EventSubject <IEvent > | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:44 |
onTransformChange$ | public | EventSubject <ITransformChangeState > | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:46 |
renderEvenInBackground | public | boolean | true | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:34 |
renderFrameTags$ | readonly | Subject <[string , any ]> | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:42 |
renderFrameTimeMetric$ | readonly | Subject <ITimeMetric > | undefined | - | packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:41 |
Accessors
activeScene
Get Signature
get activeScene(): null | Scene
Returns
null
| Scene
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:181
classType
Get Signature
get classType(): RENDER_CLASS_TYPE
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:177
clientRect$
Get Signature
get clientRect$(): Observable<void>
Returns
Observable
<void
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:59
elapsedTime
Get Signature
get elapsedTime(): number
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:165
frameId
Get Signature
get frameId(): number
Gets the current frame id
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:225
height
Get Signature
get height(): number
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:173
requestNewFrameHandler
Get Signature
get requestNewFrameHandler(): number
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:218
width
Get Signature
get width(): number
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:169
Methods
_beginFrame()
_beginFrame(_timestamp): void
Begin a new frame
Parameters
Parameter | Type |
---|---|
_timestamp | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:421
_endFrame()
_endFrame(timestamp): void
End the current frame
Parameters
Parameter | Type |
---|---|
timestamp | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:429
_init()
_init(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:161
addFunction2RenderLoop()
addFunction2RenderLoop(renderFunction): void
Parameters
Parameter | Type |
---|---|
renderFunction | () => void |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:373
addScene()
addScene(sceneInstance): Scene
Parameters
Parameter | Type |
---|---|
sceneInstance | Scene |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:197
clearCanvas()
clearCanvas(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:234
dispose()
dispose(): void
Returns
void
Overrides
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:334
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:100
getCanvas()
getCanvas(): Canvas
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:238
getCanvasElement()
getCanvasElement(): HTMLCanvasElement
Returns
HTMLCanvasElement
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:242
getDeltaTime()
getDeltaTime(): number
Gets the time spent between current and previous frame
Returns
number
a number representing the delta time in ms
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:452
getFps()
getFps(): number
Gets the current framerate
Returns
number
a number representing the framerate
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:444
getPixelRatio()
getPixelRatio(): number
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:258
getScene()
getScene(sceneKey): null | Scene
Parameters
Parameter | Type |
---|---|
sceneKey | string |
Returns
null
| Scene
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:189
getScenes()
getScenes(): {}
Returns
{}
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:185
hasActiveScene()
hasActiveScene(): boolean
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:214
hasScene()
hasScene(sceneKey): boolean
Parameters
Parameter | Type |
---|---|
sceneKey | string |
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:193
resize()
resize(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:294
resizeBySize()
resizeBySize(width, height): void
set canvas element size
Parameters
Parameter | Type |
---|---|
width | number |
height | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:317
runRenderLoop()
runRenderLoop(renderFunction): void
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
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:392
setActiveScene()
setActiveScene(sceneKey): null | Scene
Parameters
Parameter | Type |
---|---|
sceneKey | string |
Returns
null
| Scene
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:206
setCanvasCursor()
setCanvasCursor(val): void
Parameters
Parameter | Type |
---|---|
val | CURSOR_TYPE |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:229
setContainer()
setContainer(elem, resize): void
Parameters
Parameter | Type | Default value |
---|---|---|
elem | HTMLElement | undefined |
resize | boolean | true |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:262
setRemainCapture()
setRemainCapture(): void
To ensure mouse events remain bound to the host element, preventing the events from becoming ineffective once the mouse leaves the host.
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:250
startRenderLoop()
startRenderLoop(): void
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:379
stopRenderLoop()
stopRenderLoop(renderFunction?): void
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
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/engine.ts:401