CreateParticle

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

Description

Creates a particle. The named particle definition must be loaded. For more information see the particle documentation.

Syntax

bool CreateParticle (string szName, int iX, int iY, int iXDir, int iYDir, int a, int b, object pObj, bool fBehind);

Parameters

szName:
Name of the particle
iX:
X coordinate of the particle. Offset in local calls.
iY:
Y coordinate of the particle. Offset in local calls.
iXDir:
Initial horizontal velocity of the particle
iYDir:
Initial vertical velocity of the particle
a:
Extra parameter. This is usually the size of the particle in 1/5 pixels.
b:
Extra parameter. This is usually the color modulation of the particle.
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.
fBehind:
[opt] If not 0, the particle is drawn directly behind the target object.

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

CreateParticle("Blast", 0,0, 0,0, 100, RGBa(128,128,255,0));
Creates a blue explosion at the position of the calling object.
See also: ClearParticles, PushParticles
Sven2, April 2002