Skip to content

Interface: EffectContext ​

Defined in: core/types.ts:80

The services that the engine gives to an effect in setup.

Properties ​

PropertyModifierTypeDescriptionDefined in
busreadonlyEventBusThe event bus of the wand.core/types.ts:82

Methods ​

createCanvas() ​

ts
createCanvas(width, height): HTMLCanvasElement;

Defined in: core/types.ts:86

Makes an offscreen canvas, for example for a sprite.

Parameters ​

ParameterType
widthnumber
heightnumber

Returns ​

HTMLCanvasElement


random() ​

ts
random(): number;

Defined in: core/types.ts:84

Gives a random value from 0 to 1. Use it in place of Math.random.

Returns ​

number


reportError() ​

ts
reportError(error): void;

Defined in: core/types.ts:88

Sends an error to the error events of the wand.

Parameters ​

ParameterType
errorunknown

Returns ​

void