API Reference
@univerjs
@univerjs/engine-render
classes
Layer

@univerjs/engine-render v0.4.2Docs


Class: Layer

Extends

Constructors

new Layer()

new Layer(
   _scene, 
   objects, 
   _zIndex, 
   _allowCache): Layer

Parameters

ParameterTypeDefault value
_sceneSceneundefined
objectsBaseObject[][]
_zIndexnumber1
_allowCachebooleanfalse

Returns

Layer

Overrides

Disposable.constructor

Defined in

submodules/univer/packages/engine-render/src/layer.ts:36 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_dirtyprotectedbooleantrue-submodules/univer/packages/engine-render/src/layer.ts:32 (opens in a new tab)
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)

Accessors

scene

get scene(): Scene

Returns

Scene

Defined in

submodules/univer/packages/engine-render/src/layer.ts:51 (opens in a new tab)


zIndex

get zIndex(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/layer.ts:55 (opens in a new tab)

Methods

addObject()

addObject(o): Layer

Insert object to this._objects, if object is a group, insert all its children and group itself to _objects[]

Parameters

ParameterType
oBaseObject

Returns

Layer

this

Defined in

submodules/univer/packages/engine-render/src/layer.ts:113 (opens in a new tab)


addObjects()

addObjects(objects): Layer

Insert objects to this._objects, if object is a group, insert all its children and group itself to _objects[]

Parameters

ParameterType
objectsBaseObject[]

Returns

Layer

this

Defined in

submodules/univer/packages/engine-render/src/layer.ts:161 (opens in a new tab)


clear()

clear(): void

Returns

void

Defined in

submodules/univer/packages/engine-render/src/layer.ts:303 (opens in a new tab)


disableCache()

disableCache(): void

Returns

void

Defined in

submodules/univer/packages/engine-render/src/layer.ts:64 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

submodules/univer/packages/engine-render/src/layer.ts:307 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


enableCache()

enableCache(): void

Returns

void

Defined in

submodules/univer/packages/engine-render/src/layer.ts:59 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


getObjects()

getObjects(): BaseObject[]

Returns

BaseObject[]

Defined in

submodules/univer/packages/engine-render/src/layer.ts:104 (opens in a new tab)


getObjectsByOrder()

getObjectsByOrder(): BaseObject[]

Get direct visible children in order. (direct means object is not in group), default order is ascending by z-index.

Returns

BaseObject[]

objects

Defined in

submodules/univer/packages/engine-render/src/layer.ts:78 (opens in a new tab)


getObjectsByOrderForPick()

getObjectsByOrderForPick(): BaseObject[]

Get visible and evented objects.

Returns

BaseObject[]

objects

Defined in

submodules/univer/packages/engine-render/src/layer.ts:93 (opens in a new tab)


isAllowCache()

isAllowCache(): boolean

Returns

boolean

Defined in

submodules/univer/packages/engine-render/src/layer.ts:70 (opens in a new tab)


isDirty()

isDirty(): boolean

Returns

boolean

Defined in

submodules/univer/packages/engine-render/src/layer.ts:216 (opens in a new tab)


makeDirty()

makeDirty(state): Layer

Parameters

ParameterTypeDefault value
statebooleantrue

Returns

Layer

Defined in

submodules/univer/packages/engine-render/src/layer.ts:190 (opens in a new tab)


makeDirtyWithDebounce()

makeDirtyWithDebounce(state): void

Parameters

ParameterTypeDefault value
statebooleantrue

Returns

void

Defined in

submodules/univer/packages/engine-render/src/layer.ts:204 (opens in a new tab)


removeObject()

removeObject(object): void

Parameters

ParameterType
objectstring | BaseObject

Returns

void

Defined in

submodules/univer/packages/engine-render/src/layer.ts:132 (opens in a new tab)


removeObjects()

removeObjects(objects): void

Parameters

ParameterType
objectsstring[] | BaseObject[]

Returns

void

Defined in

submodules/univer/packages/engine-render/src/layer.ts:168 (opens in a new tab)


render()

render(parentCtx?, isMaxLayer?): Layer

Parameters

ParameterTypeDefault value
parentCtx?UniverRenderingContextundefined
isMaxLayer?booleanfalse

Returns

Layer

Defined in

submodules/univer/packages/engine-render/src/layer.ts:220 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.