This function draws the given particle system.
By default, every particle system that you create is drawn automatically by GameMaker. You can also draw it manually using this function.
If part_system_automatic_draw is switched off then this function will show the particles when used in the draw event of an instance. It can also be used when the drawing target is set to a surface (using surface_set_target) to draw the particles in the system to that surface.
TIP Call this function in any of the Draw Events to draw the particle system whenever you want. Call it in a Draw End event to draw the particles in front of other graphics or in one of the Draw GUI events to draw them on the GUI layer.
part_system_drawit(ind);
Argument | Type | Description |
---|---|---|
ind | Particle System Instance | The index of the particle system to draw. |
N/A
if (surface_exists(surf))
{
surface_set_target(surf);
part_system_drawit(global.psys);
surface_reset_target();
}
The above code checks to see if the surface indexed in the variable surf exists. If it does it then sets the drawing target to the surface, draws the particle system with the ID stored in the global variable, and then resets the drawing target so all normal drawing appears on the screen once more.