CastParticles

Category: Particle
Since engine version: 4.9.1.0 GWE (extended in 4.9.5.0 CE)

Description

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.

Syntax

bool CastParticles (string szName, int iAmount, int iLevel, int iX, int iY, int a0, int a1, int b0, int b1, object pObj);

Parameters

szName:
Name of the particle type
iAmount:
Amount of particles
iLevel:
Velocity at which to cast the particles
iX:
X coordinate of the particle. Offset in local calls.
iY:
Y coordinate of the particle. Offset in local calls.
a0:
Lower limit for the first extra parameter. This is usually the size of the particles in 1/5 pixels.
a1:
Upper limit for the first extra parameter
b0:
Lower limit for the second extra parameter. This is usually the color modulation of the particles.
b1:
Upper limit for the second extra parameter
pObj:
[opt] 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.

Remark

This function returns 0 if the particle function was not found. 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.

Example

CastParticles("FSpark", 10,100, 0,0, 100, 200, RGBa(128,128,255,0), RGBa(255,255,255,127));
Creates some sparks.
See also: CastObjects, CastObjectsX, CastPXS, CastPXSX, CreateParticle
Sven2, Mai 2002