Examples
import { World } from '@wimaengine/ecs'
import { createEmitter2D } from '@wimaengine/emitter'
const world = new World()
world.spawn(createEmitter2D({ prefab: () => [] }, 10, 20, Math.PI / 4))Function
createEmitter2D(prefab?: EmitterOptions, x?: number, y?: number, angle?: number): [Position2D, Orientation2D, Scale2D, GlobalTransform2D, Emitter, Timer, Children]Creates the component bundle for a 2D particle emitter entity.
The returned tuple contains Position2D, Orientation2D,
Scale2D, GlobalTransform2D, Emitter,
Timer, and Children in insertion order. The transform
starts at the supplied position and angle, with unit scale; omitted
position and angle arguments use the defaults of
createTransform2D. The optional prefab object is forwarded to
Emitter as its constructor options.
import { World } from '@wimaengine/ecs'
import { createEmitter2D } from '@wimaengine/emitter'
const world = new World()
world.spawn(createEmitter2D({ prefab: () => [] }, 10, 20, Math.PI / 4))