effect_create_layer

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

You supply a layer name or ID, 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).

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_layer(layer_id, kind, x, y, size, colour);

ArgumentTypeDescription
layer_idString or LayerThe layer 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 1: 

effect_create_layer("Particles", ef_spark, x, y, 1, c_yellow);

The code above creates a medium-sized yellow spark particle effect (ef_spark) at the (x, y) position of the calling instance, on an existing layer named "Particles". This code can be placed in a Step event of an object to create a continuous trail of sparks.