physics_particle_draw

Draw a set of particles using a sprite with the default values.

Syntax:

physics_particle_draw(typemask, category, sprite, subimg)


Argument Description
typemask The mask to compare the particles flags with.
category The user defined category to draw (use 0 to draw all categories).
sprite The sprite to use for each particle.
subimg The image_index of the sprite to draw.


Returns: N/A


Description

This function will draw a sprite at the position of all the particles that share the same user defined category value, and that have flags which coincide with those set for the mask. The mask value is defined in the same way as you would define the flags when creating the particle (see the function physics_particle_create for an example), ie: using the bitwise or "|" to mask off the appropriate bits for each flag.

NOTE: This function will draw all particles in the physics simulation with flags that coincide with those of the mask, whether they are individual particles or groups, if the user category is the same.

The drawn particle will use the colour and alpha values set when you created it, and will rotate with the angular momentum of the particle. However should you wish to scale the sprite or change any other of its drawn properties you should use the function physics_particle_draw_ext.


Example:

var flags = phy_particle_flag_water | phy_particle_flag_viscous | phy_particle_flag_tensile;
physics_particle_draw(flags, 2, sprBlob, 0);

The above code will draw a sprite for all the particles in the user defined category "2" which have the same flags as the given mask.


Back: Soft Body Particles
Next: physics_particle_draw_ext
© Copyright YoYo Games Ltd. 2018 All Rights Reserved