Files
QtGameMaker/help/files/412_03_emitters.html
T

103 lines
3.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Emitters</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Emitters</h3>
Emitters create particles. They can either create a continuous stream of
particles or can burst out a number of particles when using the appropriate
function. A particle system can have an arbitrary number of emitters.
An emitter has the following properties:
<ul>
<li><tt><b>xmin, xmax, ymin, ymax</b></tt>
indicate the extend of the region in which the particles are generated.</li>
<li><tt><b>shape</b></tt>
indicates the shape of the region. It can have the following values:</li>
<ul>
<li><tt>ps_shape_rectangle</tt></li>
<li><tt>ps_shape_ellipse</tt></li>
<li><tt>ps_shape_diamond</tt></li>
<li><tt>ps_shape_line</tt></li>
</ul>
<li><tt><b>distribution</b></tt>
indicates the distribution used to generate the particles. It can have the following values:</li>
<ul>
<li><tt>ps_distr_linear</tt>
indicates a linear distribution, that is everywhere in the region the chance is equal</li>
<li><tt>ps_distr_gaussian</tt>
indicates a Gaussian distribution in which more particles are generated
in the center than at the sides of the region</li>
<li><tt>ps_distr_invgaussian</tt>
indicates an inverse Gaussian distribution in which more particles are generated
at the sides of the region than in the center</li>
</ul>
<li><tt><b>particle type</b></tt>
indicates the type of particles being generated</li>
<li><tt><b>number</b></tt>
indicates the number of particles generated in each step.
If smaller than 0, in each step a particle is generated with a chance -1/number.
So for example with a value of -5 a particle is generated on average once every 5 steps.</li>
</ul>
<p>
The following functions are available to set the emitters and to let them
create particles. Note that each of them gets the index of the particle system
to which it belongs as a first argument.
<p>
<blockquote>
<tt><b>part_emitter_create(ps)</b></tt>
Creates a new emitter in the given particle system. It returns the
index of the emitter. This index must be used in all
calls below to set the properties of the emitter.<br>
<tt><b>part_emitter_destroy(ps,ind)</b></tt>
Destroys emitter ind in the particle system. Call this
if you don't need it anymore to save space.<br>
<tt><b>part_emitter_destroy_all(ps)</b></tt>
Destroys all emitters in the particle system that have been created.<br>
<tt><b>part_emitter_exists(ps,ind)</b></tt>
Returns whether the indicated emitter exists in the particle system.<br>
<tt><b>part_emitter_clear(ps,ind)</b></tt>
Clears the emitter ind to its default settings.<br>
<tt><b>part_emitter_region(ps,ind,xmin,xmax,ymin,ymax,shape,distribution)</b></tt>
Sets the region and distribution for the emitter.<br>
<tt><b>part_emitter_burst(ps,ind,parttype,number)</b></tt>
Bursts once <tt>number</tt> particles of the indicated type from the emitter.<br>
<tt><b>part_emitter_stream(ps,ind,parttype,number)</b></tt>
From this moment on create <tt>number</tt> particles of the indicated type
from the emitter in every step. If you indicate a number smaller
than 0 in each step a particle is generated with a chance of -1/number.
So for example with a value of -5 a particle is generated on
average once every 5 steps.<br>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
part_emitter_create()
part_emitter_destroy()
part_emitter_destroy_all()
part_emitter_exists()
part_emitter_clear()
part_emitter_region()
part_emitter_burst()
part_emitter_stream()
ps_distr_linear
ps_distr_gaussian
ps_distr_invgaussian
ps_shape_rectangle
ps_shape_ellipse
ps_shape_diamond
ps_shape_line
-->