cturtle/particles
include "cturtle/particles";
Types
ParticleBounds
Object
| Field | Type | Writable | Description |
|---|---|---|---|
valid | bool | yes | |
minX | float | yes | |
minY | float | yes | |
maxX | float | yes | |
maxY | float | yes |
ParticleEmitterDesc
Object
| Field | Type | Writable | Description |
|---|---|---|---|
rate | float | yes | |
maxLive | int | yes | |
x | float | yes | |
y | float | yes | |
direction | float | yes | |
spread | float | yes | |
speedMin | float | yes | |
speedMax | float | yes | |
lifeMin | float | yes | |
lifeMax | float | yes | |
gravityX | float | yes | |
gravityY | float | yes | |
gravityZ | float | yes | |
drag | float | yes | |
spinMin | float | yes | |
spinMax | float | yes | |
sizeCurveX1 | float | yes | |
sizeCurveY1 | float | yes | |
sizeCurveX2 | float | yes | |
sizeCurveY2 | float | yes | |
colorCurveX1 | float | yes | |
colorCurveY1 | float | yes | |
colorCurveX2 | float | yes | |
colorCurveY2 | float | yes | |
sizeStart | float | yes | |
sizeEnd | float | yes | |
startR | float | yes | |
startG | float | yes | |
startB | float | yes | |
startA | float | yes | |
endR | float | yes | |
endG | float | yes | |
endB | float | yes | |
endA | float | yes | |
image | string | yes | |
material | string | yes | |
shader | string | yes | |
blend | int | yes | |
layer | float | yes | |
trailEnabled | bool | yes | |
fromEmitter | bool | yes | |
trailPoints | int | yes | |
widthHead | float | yes | |
widthTail | float | yes | |
trailR | float | yes | |
trailG | float | yes | |
trailB | float | yes | |
trailA | float | yes | |
texture | string | yes | |
trailLifetime | float | yes |
Functions
particle_create infallible
infallible fn particle_create(ParticleEmitterDesc descriptor) -> task<int>
particle_create_resolved infallible
infallible fn particle_create_resolved(
ParticleEmitterDesc descriptor,
int image,
int trailTexture) -> task<int>
particle_destroy infallible
infallible fn particle_destroy(int emitter) -> task<bool>
particle_burst infallible
infallible fn particle_burst(int emitter, int count) -> task<bool>
particle_set_position infallible
infallible fn particle_set_position(int emitter, float x, float y) -> task<bool>
particle_set_direction infallible
infallible fn particle_set_direction(
int emitter,
float direction,
float spread) -> task<bool>
particle_set_enabled infallible
infallible fn particle_set_enabled(int emitter, bool enabled) -> task<bool>
particle_live_count infallible
infallible fn particle_live_count(int emitter) -> task<int>
particle_entity infallible
infallible fn particle_entity(int emitter) -> task<Entity>
particle_set_timeline infallible
infallible fn particle_set_timeline(
int emitter,
array<float> positions,
float step,
int seed,
int initialBurst) -> task<bool>
particle_seek infallible
infallible fn particle_seek(int emitter, float seconds) -> task<bool>
particle_bounds infallible
infallible fn particle_bounds(int emitter) -> task<ParticleBounds>
particle_set_controls infallible
infallible fn particle_set_controls(
array<int> emitters,
float direction,
array<float> spreads,
bool enabled) -> task<bool>