This function sets the interval between two consecutive bursts for the given emitter in case it is working in stream mode.
Every time the interval timer times out, i.e. after every burst, a new value for the interval is chosen as a random value between interval_min and interval_max.
NOTE The countdown timer is paused when the emitter is disabled using part_emitter_enable.
part_emitter_interval(ps, ind, interval_min, interval_max, interval_unit);
Argument | Type | Description |
---|---|---|
ps | Particle System Instance | The index of the particle system the emitter is in |
ind | Particle Emitter ID | The index of the particle emitter |
interval_min | Real | The minimum possible value for the interval, expressed in interval_unit |
interval_max | Real | The maximum possible value for the interval, expressed in interval_unit |
interval_unit | Time Source Unit Constant | The unit in which the interval values 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.