Skip to content

Commit

Permalink
docs(general): No explanation of what needs to be cleaned up when cre…
Browse files Browse the repository at this point in the history
…ating an instance of a particle system asset

YoYoGames/GameMaker-Bugs#7120

* Update of all Particles manual pages
  • Loading branch information
YYBartT committed Oct 16, 2024
1 parent 410f3a4 commit e6f63e8
Show file tree
Hide file tree
Showing 37 changed files with 1,154 additions and 1,114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>part_emitter_destroy</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand All @@ -14,11 +14,14 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>part_emitter_destroy</h1>
<p>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 <i>NOT</i> 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.</p>
<h1><span data-field="title" data-format="default">part_emitter_destroy</span></h1>
<p>This function removes the specified emitter from the given particle system and clears it from memory.</p>
<p>This will also stop any particles from being produced by the given emitter. Existing particles created by this emitter are <em>not</em> removed from the particle system.</p>
<p>This function should always be called when the given emitter is no longer needed for the system to prevent memory leaks and errors.</p>
<div data-conref="../../../../../assets/snippets/Note_Part_System_Destroy_To_Destroy_All.hts"> </div>
<p> </p>
<h4>Syntax:</h4>
<p class="code">part_emitter_destroy( ps, ind );</p>
<p class="code"><span data-field="title" data-format="default">part_emitter_destroy</span>( ps, ind );</p>
<table>
<tbody>
<tr>
Expand All @@ -28,12 +31,12 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>ps</td>
<td><span data-keyref="Type_ID_PartSys">Particle System ID</span></td>
<td><span data-keyref="Type_ID_PartSys"><a href="../Particle_Systems/part_system_create.htm" target="_blank">Particle System Instance</a></span></td>
<td>The particle system to destroy the emitter from.</td>
</tr>
<tr>
<td>ind</td>
<td><span data-keyref="Type_ID_PartEmitter">Particle Emitter ID</span></td>
<td><span data-keyref="Type_ID_PartEmitter"><a href="part_emitter_create.htm" target="_blank">Particle Emitter ID</a></span></td>
<td>The index of the emitter to destroy.</td>
</tr>
</tbody>
Expand All @@ -43,22 +46,21 @@ <h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (part_emitter_exists(global.Sname, p_emit)) <br />
<p class="code">if (part_emitter_exists(global.Sname, p_emit))<br />
{<br />
    part_emitter_destroy(global.Sname, p_emit1);<br />
    part_emitter_destroy(global.Sname, p_emit);<br />
}</p>
<p>The above code will check to see if the particle emitter indexed in the variable &quot;p_emit&quot; exists in the give particle system and if it does it is destroyed.</p>
<p> </p>
<p>The above code will check to see if the particle emitter indexed in the variable <span class="inline2">p_emit</span> exists in the give particle system and if it does it is destroyed.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Particle_Emitters.htm">Particle Emitters</a></div>
<div style="float:right">Next: <a href="part_emitter_destroy_all.htm">part_emitter_destroy_all</a></div>
<div style="float:left">Back: <a data-xref="{title}" href="Particle_Emitters.htm">Particle Emitters</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="part_emitter_destroy_all.htm">part_emitter_destroy_all</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2022 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
part_emitter_destroy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>part_emitter_destroy_all</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand All @@ -14,45 +14,49 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>part_emitter_destroy_all</h1>
<p>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 <i>NOT</i> 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.</p>
<h1><span data-field="title" data-format="default">part_emitter_destroy_all</span></h1>
<p>This function removes all defined emitters from the given particle system and clears them from memory.</p>
<p>This will also stop any particles from being produced by the emitters. Existing particles created by the emitters are <em>not</em> removed from the system.</p>
<p>This function should always be called when the emitters are no longer needed for the system to prevent memory leaks and errors.</p>
<div data-conref="../../../../../assets/snippets/Note_Part_System_Destroy_To_Destroy_All.hts"> </div>
<p> </p>
<h4>Syntax:</h4>
<p class="code">part_emitter_destroy_all( ps );</p>
<p class="code"><span data-field="title" data-format="default">part_emitter_destroy_all</span>( ps );</p>
<table>
<tbody>
<tr class="rh-cursor-column">
<th>Argument</th><th>Type</th>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</tr>
<tr>
<td>ps</td><td><span data-keyref="Type_ID_PartSys"></span></td>
<td>ps</td>
<td><span data-keyref="Type_ID_PartSys"><a href="../Particle_Systems/part_system_create.htm" target="_blank">Particle System Instance</a></span></td>
<td>The particle system to destroy all emitters from.</td>
</tr>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void"></span></p>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (lives == 0) <br />
<p class="code">if (lives == 0)<br />
{<br />
    part_emitter_destroy_all(global.Sname);<br />
    room_goto(rm_Menu);<br />
}</p>
<p>The above code checks the built in global variable &quot;lives&quot; and if it is 0, it destroys all particle emitters and then changes room.</p>
<p> </p>
<p>The above code checks the built-in global variable <span class="inline2"><a data-xref="{title}" href="../../../../GML_Overview/Variables/Builtin_Global_Variables/lives.htm">lives</a></span> and if it is 0, it destroys all particle emitters and then changes room.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Particle_Emitters.htm">Particle Emitters</a></div>
<div style="float:right">Next: <a href="part_emitter_exists.htm">part_emitter_exists</a></div>
<div style="float:left">Back: <a data-xref="{title}" href="Particle_Emitters.htm">Particle Emitters</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="part_emitter_exists.htm">part_emitter_exists</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2021 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
part_emitter_destroy_all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">Particle Systems</span></h1>
<p>Before you can create particles you need to create a particle system. This is a &quot;container&quot; 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.</p>
<p>Before you can create particles you need to create a particle system. This is a &quot;container&quot; 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.</p>
<p>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.</p>
<div data-conref="../../../../../assets/snippets/Note_tip_use_particle_system_editor.hts"> </div>
<h2 id="h">Copy GML to Clipboard</h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,67 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>part_particles_clear</title>
<meta name="generator" content="Adobe RoboHelp 2020"/>
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css"/>
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Mark Alexander"/>
<meta name="topic-comment" content="Reference page for part_particles_clear"/>
<meta name="rh-index-keywords" content="part_particles_clear"/>
<meta name="search-keywords" content="part_particles_clear"/>
</head>
<body><!--<div class="body-scroll" style="top: 150px;">-->
<h1>part_particles_clear</h1>
<p>With this function you can clear all the particles currently created by the system from the room. It does <i>not</i> 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.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">part_particles_clear(ind);</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>ind</td>
<td><span data-keyref="Type_ID_PartSys">Particle System ID</span></td>
<td>The particle system.</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (lives &lt;= 0)
<br/>
{
<br/>
part_particles_clear(global.Sname);
<br/>
room_goto(rm_intro);
<br/>
}</p>
<p>The above code will check the value of the variable &quot;lives&quot; and if it is equal to 0, it clears all particles from the system and then changes room.</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Particle_Systems.htm">Particle Systems</a></div>
<div style="float:right">Next: <a href="part_particles_count.htm">part_particles_count</a></div>
</div>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>part_particles_clear</title>
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Mark Alexander" />
<meta name="topic-comment" content="Reference page for part_particles_clear" />
<meta name="rh-index-keywords" content="part_particles_clear" />
<meta name="search-keywords" content="part_particles_clear" />
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">part_particles_clear</span></h1>
<p>This function clears all particles currently created by the system from the room.</p>
<p>It does <i>not</i> 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.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">part_particles_clear</span>(ind);</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>ind</td>
<td><span data-keyref="Type_ID_PartSys"><a href="part_system_create.htm" target="_blank">Particle System Instance</a></span></td>
<td>The particle system.</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (lives &lt;= 0)<br />
{<br />
    part_particles_clear(global.Sname);<br />
    room_goto(rm_intro);<br />
}</p>
<p>The above code will check the value of the variable <span class="inline2"><a data-xref="{title}" href="../../../../GML_Overview/Variables/Builtin_Global_Variables/lives.htm">lives</a></span> and if it is equal to 0, it clears all particles from the system and then changes room.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a data-xref="{title}" href="Particle_Systems.htm">Particle Systems</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="part_particles_count.htm">part_particles_count</a></div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2022 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
part_particles_clear
--><!-- TAGS
-->
<!-- TAGS
part_particles_clear
--></body>
-->
</body>
</html>
Loading

0 comments on commit e6f63e8

Please sign in to comment.