openclonk/docs/sdk/script/fn/CastParticles.xml

82 lines
3.0 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>CastParticles</title>
<category>Particle</category>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>string</type>
<name>name</name>
<desc>Name of the particle type.</desc>
</param>
<param>
<type>int</type>
<name>amount</name>
<desc>Amount of particles.</desc>
</param>
<param>
<type>int</type>
<name>level</name>
<desc>Velocity at which to cast the particles.</desc>
</param>
<param>
<type>int</type>
<name>x</name>
<desc>X coordinate of the particle. Offset in local calls.</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y coordinate of the particle. Offset in local calls.</desc>
</param>
<param>
<type>int</type>
<name>a0</name>
<desc>Lower limit for the first extra parameter. This is usually the size of the particles in 1/5 pixels.</desc>
</param>
<param>
<type>int</type>
<name>a1</name>
<desc>Upper limit for the first extra parameter.</desc>
</param>
<param>
<type>int</type>
<name>b0</name>
<desc>Lower limit for the second extra parameter. This is usually the color modulation of the particles.</desc>
</param>
<param>
<type>int</type>
<name>b1</name>
<desc>Upper limit for the second extra parameter.</desc>
</param>
<param>
<type>object</type>
<name>obj</name>
<desc>Target object for object local particles. Object local particles are drawn directly on top of the object and are removed when the object is deleted.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Casts the specified amount of particles of the specified type. The extra parameters are set randomly in the range from a0/b0 to a1/b1.</desc>
<remark>This function returns <code>false</code> if the particle definition was not found, otherwise <code>true</code>. There is no return value indicating whether the particle has actually been created. This must be so to prevent synchronization problems in network games, as particles may be handled differently on each computer in the network.</remark>
<examples>
<example>
<code>CastParticles(&quot;MagicSpark&quot;, 10,100, 0,0, 100, 200, <funclink>RGBa</funclink>(128,128,255,0), <funclink>RGBa</funclink>(255,255,255,127));</code>
<text>Creates some sparks.</text>
</example>
</examples>
<related>
<funclink>CreateParticle</funclink>
<funclink>CastObjects</funclink>
<funclink>CastPXS</funclink>
</related>
</func>
<author>Sven2</author><date>2002-05</date>
</funcs>