Type Definitions
Color
- Description:
- Represents the color state of a particle. RGB color channels are stored independently for efficient interpolation.
- Source:
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
r |
number |
<optional> |
255
|
Red color channel value (0 to 255). |
g |
number |
<optional> |
255
|
Green color channel value (0 to 255). |
b |
number |
<optional> |
255
|
Blue color channel value (0 to 255). |
Represents the color state of a particle. RGB color channels are stored independently for efficient interpolation.
Type:
- object
ColorRampConfig
- Description:
- ColorRamp configuration options. Includes all properties from ModifierConfig.
- Source:
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
colors |
Array.<Array.<number>> |
<optional> |
[[255, 255, 255], [0, 0, 0]]
|
Array of RGB color arrays. |
ColorRamp configuration options.
Includes all properties from ModifierConfig.
Type:
- object
CullingBounds
- Description:
- Defines a region beyond which particles are considered outside the simulation and are marked dead. A safety margin is applied per particle based on its position and size, preventing early removal while it is still partially inside the region.
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
xMin |
number | Left boundary of the region. |
yMin |
number | Top boundary of the region. |
xMax |
number | Right boundary of the region. |
yMax |
number | Bottom boundary of the region. |
Defines a region beyond which particles are considered outside the simulation and are marked dead.
A safety margin is applied per particle based on its position and size, preventing early removal while it is still
partially inside the region.
Type:
- object
DirectionalForceConfig
- Description:
- DirectionalForce configuration options. Includes all properties from ForceConfig.
- Source:
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
ax |
number |
<optional> |
0
|
Horizontal acceleration component (in pixels per second). |
ay |
number |
<optional> |
0
|
Vertical acceleration component (in pixels per second). |
DirectionalForce configuration options.
Includes all properties from ForceConfig.
Type:
- object
EmitterConfig
- Description:
- Emitter configuration options.
- Source:
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id |
string |
<optional> |
Unique identifier. Defaults to a generated UUID. | |
enabled |
boolean |
<optional> |
true
|
Flag indicating whether the emitter is running or not. |
looping |
boolean |
<optional> |
true
|
Flag indicating whether a finite-duration emitter restarts when its time is up. |
particlesPerSecond |
number |
<optional> |
10
|
Continuous emission rate of new particles per second. |
duration |
number |
<optional> |
Gnist.INFINITE_DURATION
|
Duration of particle emission (in seconds), where -1 represents infinite emission. |
x |
number |
<optional> |
0
|
Current horizontal coordinate of the emitter origin. |
y |
number |
<optional> |
0
|
Current vertical coordinate of the emitter origin. |
particleBlueprint |
ParticleBlueprint |
<optional> |
{}
|
Configuration for emitted particles. |
Emitter configuration options.
Type:
- object
EngineConfig
- Description:
- Engine configuration options.
- Source:
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
cullingBounds |
CullingBounds | null |
<optional> |
null
|
Optional region used for particle culling. |
Engine configuration options.
Type:
- object
ForceConfig
- Description:
- Force configuration options.
- Source:
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string |
<optional> |
Unique identifier. Defaults to a generated UUID. |
Force configuration options.
Type:
- object
LinearDragConfig
- Description:
- LinearDrag configuration options. Includes all properties from ForceConfig.
- Source:
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
drag |
number |
<optional> |
0.99
|
Friction coefficient where 0 means no drag and higher values slow particles down faster. |
LinearDrag configuration options.
Includes all properties from ForceConfig.
Type:
- object
ModifierConfig
- Description:
- Modifier configuration options.
- Source:
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string |
<optional> |
Unique identifier. Defaults to a generated UUID. |
Modifier configuration options.
Type:
- object
OpacityFadeConfig
- Description:
- OpacityFade configuration options. Includes all properties from ModifierConfig.
- Source:
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
startOpacity |
number |
<optional> |
1.0
|
Opacity at particle emission. |
endOpacity |
number |
<optional> |
0.0
|
Opacity at particle death. |
OpacityFade configuration options.
Includes all properties from ModifierConfig.
Type:
- object
ParticleBlueprint
- Description:
- Configuration options used by emitters to initialize particles at emission. This object is not runtime Particle state and does not correspond directly to Particle properties. Options are interpreted either directly or indirectly to derive Particle properties. Most options may be specified as a single number or a [min, max] range array.
- Source:
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
rotation |
number | Array.<number> |
<optional> |
Orientation angle in radians. |
angularVelocity |
number | Array.<number> |
<optional> |
Angular rotation speed (radians per second). |
size |
number | Array.<number> |
<optional> |
The visual size or scale factor. Interpreted by the renderer as pixels, radius, or a transform scale. |
color |
Color |
<optional> |
RGB color channels. |
opacity |
number | Array.<number> |
<optional> |
Transparency (0.0 = fully transparent, 1.0 = fully opaque). |
lifespan |
number | Array.<number> |
<optional> |
Maximum allowed lifespan (in seconds). |
speed |
number | Array.<number> |
<optional> |
Speed (in pixels per second) used to derive the particle's initial horizontal and vertical velocity. |
direction |
number | Array.<number> |
<optional> |
Movement direction angle (in radians) used to derive the particle's initial horizontal and vertical velocity. |
Configuration options used by emitters to initialize particles at emission.
This object is not runtime Particle state and does not correspond directly to Particle properties.
Options are interpreted either directly or indirectly to derive Particle properties.
Most options may be specified as a single number or a [min, max] range array.
Type:
- object