Skip to main content

Namespace: sources

index.sources

Type aliases#

DynamicSourceType#

Ƭ DynamicSourceType: Circle | Rect | HTMLElement | MouseEvent

Represents all types where a source type can be dynamically inferred.

Defined in#

systems/sources.ts:11


SourceSampler#

Ƭ SourceSampler: () => Vector

Type declaration#

â–¸ (): Vector

Represents a method used for sampling points to emit particles from.

Returns#

Vector

Defined in#

systems/sources.ts:7

Functions#

circleSource#

â–¸ circleSource(source): SourceSampler

Creates a sampler to retrieve random points inside a specified circle.

Parameters#

NameType
sourceCircle

Returns#

SourceSampler

Defined in#

systems/sources.ts:59


dynamicSource#

â–¸ dynamicSource(source): SourceSampler

Dynamically infers a source sampler for the specified source type.

Parameters#

NameType
sourceunknown

Returns#

SourceSampler

Defined in#

systems/sources.ts:16


elementSource#

â–¸ elementSource(source): SourceSampler

Creates a sampler to retrieve random points inside a specified HTMLElement.

Parameters#

NameType
sourceHTMLElement

Returns#

SourceSampler

Defined in#

systems/sources.ts:36


mouseSource#

â–¸ mouseSource(source): SourceSampler

Creates a sampler to retrieve the position of a mouse event.

Parameters#

NameType
sourceMouseEvent

Returns#

SourceSampler

Defined in#

systems/sources.ts:43


rectSource#

â–¸ rectSource(source): SourceSampler

Creates a sampler to retrieve random points inside a specified rectangle.

Parameters#

NameType
sourceRect

Returns#

SourceSampler

Defined in#

systems/sources.ts:53