This function sets the delay before the particle emitter creates particles for the first time when it is in stream mode.
The value for the delay is chosen to be a random value between delay_min and delay_max.
NOTE The countdown timer is paused when the emitter is disabled using part_emitter_enable.
part_emitter_delay(ps, ind, delay_min, delay_max, delay_unit);
Argument | Type | Description |
---|---|---|
ps | Particle System Instance | The index of the particle system containing the emitter |
ind | Particle Emitter ID | The emitter index |
delay_min | Real | The minimum possible value for the delay, expressed in delay_unit |
delay_max | Real | The maximum possible value for the delay, expressed in delay_unit |
delay_unit | Time Source Unit Constant | The unit in which delay_min and delay_max are expressed |
N/A
Create Event
ps = part_system_create();
part_system_position(ps, x, y);
pe = part_emitter_create(ps);
part_emitter_region(ps, pe, 100, 200, 100, 200, ps_shape_ellipse, ps_distr_linear);
part_emitter_delay(ps, pe, 1, 1, time_source_units_seconds);
part_emitter_interval(ps, pe, 0.4, 1.1, time_source_units_seconds);
pt = part_type_create();
part_emitter_stream(ps, pe, pt, 20);
Cleanup Event
part_emitter_destroy(pe);
part_system_destroy(ps);
part_type_destroy(pt);
The code above sets up a particle system ps with a single emitter pe in the Create event. The emitter is configured to emit particles in a circle shape of 100x100 pixels and to wait for 1 second to start streaming (using part_emitter_delay) after being "turned on" with part_emitter_stream. Using part_emitter_interval it is configured to keep emitting particles every 0.4 to 1.1 seconds (i.e. the interval between two "bursts" in stream mode is at least 0.4 seconds and at most 1.1 seconds.
A new particle type pt is then created and the emitter set to create 20 of them at a time using part_emitter_stream.
Finally, since they're dynamic resources, the particle emitter, the system and the type are all destroyed in the Cleanup event.