diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Emitters/part_emitter_destroy.htm b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Emitters/part_emitter_destroy.htm index c4c31cf71..2f1c7dd1f 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Emitters/part_emitter_destroy.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Emitters/part_emitter_destroy.htm @@ -4,7 +4,7 @@ part_emitter_destroy - + @@ -14,11 +14,14 @@ -

part_emitter_destroy

-

This function will remove the specified emitter from the given system and clear it from memory (this will also stop any particles from being produced by the given emitter, but it does NOT remove them from the room). This function should always be called when the given emitter is no longer needed for the system to prevent memory leaks and errors.

+

part_emitter_destroy

+

This function removes the specified emitter from the given particle system and clears it from memory.

+

This will also stop any particles from being produced by the given emitter. Existing particles created by this emitter are not removed from the particle system.

+

This function should always be called when the given emitter is no longer needed for the system to prevent memory leaks and errors.

+

 

Syntax:

-

part_emitter_destroy( ps, ind );

+

part_emitter_destroy( ps, ind );

@@ -28,12 +31,12 @@

Syntax:

- + - + @@ -43,22 +46,21 @@

Returns:

N/A

 

Example:

-

if (part_emitter_exists(global.Sname, p_emit))
+

if (part_emitter_exists(global.Sname, p_emit))
{
-     part_emitter_destroy(global.Sname, p_emit1);
+     part_emitter_destroy(global.Sname, p_emit);
}

-

The above code will check to see if the particle emitter indexed in the variable "p_emit" exists in the give particle system and if it does it is destroyed.

-

 

+

The above code will check to see if the particle emitter indexed in the variable p_emit exists in the give particle system and if it does it is destroyed.

 

 

-

part_emitter_destroy_all

-

This function will remove all defined emitters from the given system and clear them from memory (this will also stop any particles from being produced by the given emitter, but it does NOT remove them from the room). This function should always be called when the emitters are no longer needed for the system to prevent memory leaks and errors.

+

part_emitter_destroy_all

+

This function removes all defined emitters from the given particle system and clears them from memory.

+

This will also stop any particles from being produced by the emitters. Existing particles created by the emitters are not removed from the system.

+

This function should always be called when the emitters are no longer needed for the system to prevent memory leaks and errors.

+

 

Syntax:

-

part_emitter_destroy_all( ps );

+

part_emitter_destroy_all( ps );

psParticle System IDParticle System Instance The particle system to destroy the emitter from.
indParticle Emitter IDParticle Emitter ID The index of the emitter to destroy.
- - + + + - + - + + - +
ArgumentType
ArgumentType Description
pspsParticle System Instance The particle system to destroy all emitters from.

 

Returns:

-

+

N/A

 

Example:

-

if (lives == 0)
+

if (lives == 0)
{
    part_emitter_destroy_all(global.Sname);
    room_goto(rm_Menu);
}

-

The above code checks the built in global variable "lives" and if it is 0, it destroys all particle emitters and then changes room.

-

 

+

The above code checks the built-in global variable lives and if it is 0, it destroys all particle emitters and then changes room.

 

 

Particle Systems

-

Before you can create particles you need to create a particle system. This is a "container" where you place your particles and emitters (if you need them) ready for use, and you can put as many or as few particles into any one system as you think necessary, and you can have as many systems as you think necessary too. However, it is always better to keep this number as small as possible due to the fact that each system, emitter and particle takes up memory and having too many of them may slow your game down or cause problems. For example, if you need some effects to appear above instances, and other effects to appear beneath instances, you would create two systems and set their depths to get the desired effect, with all particles that are added to each system being drawn at the depth you specify.

+

Before you can create particles you need to create a particle system. This is a "container" where you place your particles and emitters (if you need them) ready for use, and you can put as many or as few particles into any one system as you think necessary, and you can have as many systems as you think necessary too. However, it is always better to keep this number as small as possible due to the fact that each system, emitter and particle takes up memory and having too many of them may slow your game down or cause problems. For example, if you need some effects to appear above instances, and other effects to appear below instances, you would create two systems and set their depths to get the desired effect, with all particles that are added to each system being drawn at the depth you specify.

Since a particle system is a dynamically created resource, you must create it and store the returned index in a variable to reference the system in all further function calls, and it is very important that you also destroy the system when it is no longer needed or else you will have a memory leak that will slow down and eventually crash your game. It is also worth noting that particle systems will live on forever after they are created, even if the index is no longer stored. So even if you change room or restart the game, the systems and the particles will remain, and be visible, in all further rooms so you better make sure you destroy them once you no longer need them.

Copy GML to Clipboard

diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Systems/part_particles_clear.htm b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Systems/part_particles_clear.htm index 988e61d71..31593d9ff 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Systems/part_particles_clear.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Particles/Particle_Systems/part_particles_clear.htm @@ -1,67 +1,66 @@ - + - - - part_particles_clear - - - - - - - - - -

part_particles_clear

-

With this function you can clear all the particles currently created by the system from the room. It does not reset or remove the particle types themselves, just their visual representation, and if you have any object streaming particles from an emitter, these particles disappear but will begin to appear again the next step after calling this code.

-

-

Syntax:

-

part_particles_clear(ind);

- - - - - - - - - - - - - -
ArgumentTypeDescription
indParticle System IDThe particle system.
-

-

Returns:

-

N/A

-

-

Example:

-

if (lives <= 0) -
- { -
- part_particles_clear(global.Sname); -
- room_goto(rm_intro); -
- }

-

The above code will check the value of the variable "lives" and if it is equal to 0, it clears all particles from the system and then changes room.

-

-

-

-