effect_create_depth

This function creates a simple particle effect at the given depth.

You supply a depth value and a particle kind, along with its position, size and colour. The size takes three possible values: 0 (small), 1 (medium), or 2 (large).

NOTE The effect types ef_rain and ef_snow don't use the x/y position (although you must still provide them).

NOTE Depth values are approximate. If you try to draw things at depth values close to the maximum depth and minimum depth, they may not be drawn due to inaccuracies introduced by the calculations.

The available constants for the different particle kinds are: 

ConstantExampleDescription
ef_cloudcloud effect exampleAn effect that creates random cloud particles of varying sizes
ef_ellipseellipse effect exampleAn effect that creates expanding ellipses
ef_explosionexplosion effect exampleAn effect that creates expanding fading explosions
ef_fireworkfirework effect exampleAn effect that creates multiple small particles to generate a firework explosion
ef_flareflare effect exampleAn effect that generates a brilliant point that flares up and fades out
ef_rainrain effect exampleAn effect that generates rain particles coming down from the top of the screen
ef_ringcircle effect exampleAn effect that generates expanding and fading circles
ef_smokesmoke effect exampleAn effect that generates little puffs of smoke
ef_smokeuprising smoke effect exampleAn effect that creates a smoke plume that rises up the screen
ef_snowsnow effect exampleAn effect that generates multiple snow particles falling down the screen
ef_sparkspark effect exampleAn effect that generates a small spark
ef_starstar effect exampleAn effect that generates star particles

 

Syntax:

effect_create_depth(depth, kind, x, y, size, colour);

ArgumentTypeDescription
depthRealThe depth at which to create the effect
kindEffect Type ConstantThe kind of effect to create
xRealThe x position to create the effect at (unused by ef_rain and ef_snow)
yRealThe y position to create the effect at (unused by ef_rain and ef_snow)
sizeRealThe size of the effect (0 = small, 1 = medium, 2 = large)
colourColourThe colour of the effect

 

Returns:

N/A

 

Example:

effect_create_depth(depth, ef_explosion, x, y, 2, c_dkgray);

The code above creates a large, dark gray coloured explosion particle effect (ef_explosion) at the depth and x, y position of the calling instance.