Particle Effects Runtime - Grisgram/gml-raptor GitHub Wiki

raptor objects for particles

When you define one or more layers for your particles in the particle_layer_names variable of your RoomController in a room, a ParticleManager instance is created for each layer named in the variable when the RoomController gets created. This manager offers all functions you need to control your particles at runtime.

The ParticleManager class

This class always gets created through the RoomController, you don't have to create one by yourself.

To access a ParticleManager in a Room, you use the PARTSYS macro.

  • If you have only one single layer defined for your particles, you can simply use PARTSYS.<function> to invoke the ParticleManager.
  • If you have specified an array for your layers, you access the ParticleManager for a layer through PARTSYS[i].<function>, where i is the PARTSYS Index you specified in the Particle Editor when exporting your code to raptor. See, how this all fits together? Good, then let's continue...

The ParticleManager offers many useful function to start, control, burst or stop your particle effects. To understand the terminology, first a bit of theory.

What is a particle, what is an emitter?

When you write with a pen on a sheet of paper, the tip of your pen is the emitter and the ink that makes the words visible is the particles.
In other words, an emitter creates particles. While you will not get exclusive control over each single particle you create (normally you create hundreds of them and they have their rules set through the Particle Editor), you do have control over the emitter.

An emitter can stream or burst particles.
A stream is a constant... well... stream of particles coming out of the emitter. Where exactly they appear is defined by the emitter range. How many appear, is defined by the particles_per_frame argument.
Bursting particles is more like a one-shot effect (an explosion for instance or the dust bursting on ground when something big lands or jumps). As a burst is not a stream, there is no particles_per_frame argument, instead you define the intensity of the burst with a particle_count argument. That many particles get created instantly, follow their rules until they die.


Continue reading in Emitter Functions.

⚠️ **GitHub.com Fallback** ⚠️