Extends
Members
emissionSource :string
- Description:
- Emission source mode, defining the geometric distribution and initial direction of emitted particles. The default direction depends on both the emission source mode and the emitter type and can be overridden by specifying `particleBlueprint.direction` in the emitter config.
- Source:
- Inherited From:
- See:
-
- EmissionSourceValues for available configuration constants.
Emission source mode, defining the geometric distribution and initial direction of emitted particles.
The default direction depends on both the emission source mode and the emitter type and can be overridden by specifying
`particleBlueprint.direction` in the emitter config.
Type:
- string
particlesPerSecond :number
- Description:
- Continuous emission rate of new particles per second.
- Source:
- Inherited From:
Continuous emission rate of new particles per second.
Type:
- number
x :number
- Description:
- Current horizontal coordinate of the emitter origin.
- Source:
- Inherited From:
Current horizontal coordinate of the emitter origin.
Type:
- number
y :number
- Description:
- Current vertical coordinate of the emitter origin.
- Source:
- Inherited From:
Current vertical coordinate of the emitter origin.
Type:
- number
Methods
addModifier(modifier) → {void}
- Description:
- Registers a modifier to be applied to the particles emitted by the emitter.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
modifier |
Modifier | Modifier instance to register. |
Throws:
Error
Returns:
- Type
- void
addScopedForce(force) → {void}
- Description:
- Registers a scoped emitter-specific force to be applied to the particles emitted by the emitter.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
force |
Force | Force instance to register. |
Returns:
- Type
- void
getModifier(id) → {Modifier|null}
- Description:
- Finds a registered modifier by its unique identifier.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The unique identifier of the target modifier. |
Returns:
The modifier instance if found, null otherwise.
- Type
- Modifier | null
getScopedForce(id) → {Force|null}
- Description:
- Finds a registered scoped emitter-specific force by its unique identifier.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The unique identifier of the target force. |
Returns:
The force instance if found, null otherwise.
- Type
- Force | null
pause() → {void}
- Description:
- Temporarily halts particle emission and locks internal tracking.
- Source:
- Inherited From:
Returns:
- Type
- void
removeModifier(id) → {boolean}
- Description:
- Removes a modifier from any of the emitter's registered modifier lists by its unique identifier.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The unique identifier of the target modifier. |
Returns:
True if found and successfully removed, false otherwise.
- Type
- boolean
removeScopedForce(id) → {boolean}
- Description:
- Removes a scoped emitter-specific force from the emitter's registered forces lists by its unique identifier.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The unique identifier of the target force. |
Returns:
True if found and successfully removed, false otherwise.
- Type
- boolean
resume() → {void}
- Description:
- Resumes particle emission and internal tracking from where they were paused.
- Source:
- Inherited From:
Returns:
- Type
- void
start() → {void}
- Description:
- Starts or forcefully restarts particle emission from the beginning. Resets internal tracking and sets the emitter to an active state.
- Source:
- Inherited From:
Returns:
- Type
- void
stop() → {void}
- Description:
- Halts particle emission and resets internal tracking. The emitter is deactivated but remains ready to be started again.
- Source:
- Inherited From:
Returns:
- Type
- void
update(dt, particlePool) → {void}
- Description:
- Updates the emitter's internal timer and returns any new particles to be emitted in the current frame.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
dt |
number | Time elapsed since the last frame (in seconds). |
particlePool |
Array.<Particle> | Reference to the internal collection of active particles in the main {Gnist} class. |
Returns:
- Type
- void