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
Section<N,S>
Type Parameters
| Type Parameter | Default type |
|---|---|
N extends string | string |
S extends Schema | Schema |
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
composite? | readonly | GlobalCompositeOperation | The composite operation for draw. The default is source-over. | - | core/types.ts:100 |
layer | readonly | number | The draw order. The engine draws a low layer first. | - | core/types.ts:98 |
name | readonly | N | The unique name of the section. It is the key in the configuration document. | Section.name | config/types.ts:56 |
schema | readonly | S | The fields of the section. | Section.schema | config/types.ts:58 |
Methods
clear()
clear(): void;Defined in: core/types.ts:114
Removes the state. The engine calls it when the effect becomes disabled.
Returns
void
configure()
configure(config, theme): void;Defined in: core/types.ts:104
Gets the resolved values of the section after each change.
Parameters
| Parameter | Type |
|---|---|
config | EffectConfig<S> |
theme | ThemeConfig |
Returns
void
destroy()
destroy(): void;Defined in: core/types.ts:116
Releases all resources.
Returns
void
draw()
draw(context, frame): void;Defined in: core/types.ts:110
Draws the state. The transform of the context converts document coordinates.
Parameters
| Parameter | Type |
|---|---|
context | CanvasRenderingContext2D |
frame | Frame |
Returns
void
isIdle()
isIdle(): boolean;Defined in: core/types.ts:112
Tells if the effect has nothing to draw.
Returns
boolean
pointer()?
optional pointer(event): void;Defined in: core/types.ts:106
Gets each pointer event.
Parameters
| Parameter | Type |
|---|---|
event | WandPointerEvent |
Returns
void
setup()
setup(context): void;Defined in: core/types.ts:102
Gets the services of the engine. The engine calls it one time.
Parameters
| Parameter | Type |
|---|---|
context | EffectContext |
Returns
void
update()
update(frame): void;Defined in: core/types.ts:108
Moves the state forward by one frame.
Parameters
| Parameter | Type |
|---|---|
frame | Frame |
Returns
void