Skip to content

Interface: Effect<N, S> ​

Defined in: core/types.ts:95

An effect draws on the canvas of the wand. It is also a configuration section.

Extends ​

Type Parameters ​

Type ParameterDefault type
N extends stringstring
S extends SchemaSchema

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
composite?readonlyGlobalCompositeOperationThe composite operation for draw. The default is source-over.-core/types.ts:100
layerreadonlynumberThe draw order. The engine draws a low layer first.-core/types.ts:98
namereadonlyNThe unique name of the section. It is the key in the configuration document.Section.nameconfig/types.ts:56
schemareadonlySThe fields of the section.Section.schemaconfig/types.ts:58

Methods ​

clear() ​

ts
clear(): void;

Defined in: core/types.ts:114

Removes the state. The engine calls it when the effect becomes disabled.

Returns ​

void


configure() ​

ts
configure(config, theme): void;

Defined in: core/types.ts:104

Gets the resolved values of the section after each change.

Parameters ​

ParameterType
configEffectConfig<S>
themeThemeConfig

Returns ​

void


destroy() ​

ts
destroy(): void;

Defined in: core/types.ts:116

Releases all resources.

Returns ​

void


draw() ​

ts
draw(context, frame): void;

Defined in: core/types.ts:110

Draws the state. The transform of the context converts document coordinates.

Parameters ​

ParameterType
contextCanvasRenderingContext2D
frameFrame

Returns ​

void


isIdle() ​

ts
isIdle(): boolean;

Defined in: core/types.ts:112

Tells if the effect has nothing to draw.

Returns ​

boolean


pointer()? ​

ts
optional pointer(event): void;

Defined in: core/types.ts:106

Gets each pointer event.

Parameters ​

ParameterType
eventWandPointerEvent

Returns ​

void


setup() ​

ts
setup(context): void;

Defined in: core/types.ts:102

Gets the services of the engine. The engine calls it one time.

Parameters ​

ParameterType
contextEffectContext

Returns ​

void


update() ​

ts
update(frame): void;

Defined in: core/types.ts:108

Moves the state forward by one frame.

Parameters ​

ParameterType
frameFrame

Returns ​

void