Skip to content

Commit

Permalink
docs(feature): Fixed indentation for code blocks that got messed up b…
Browse files Browse the repository at this point in the history
…ecause of search and replace on August 28, 2024
  • Loading branch information
gurpreetsinghmatharoo committed Nov 21, 2024
1 parent add0308 commit 8e3f441
Show file tree
Hide file tree
Showing 127 changed files with 7,610 additions and 7,924 deletions.
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
<?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>depth</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="Page outlining the variable depth"/>
<meta name="rh-index-keywords" content="depth"/>
<meta name="search-keywords" content="depth"/>
</head>
<body><!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">depth</span></h1>
<p>When you create an object you can assign it an initial <i>depth</i> which defines how the instances of that object will be drawn in the room when the game is being played and this variable can be used to get and to change that depth value while the game is running. You would normally not need to use this variable as you should be setting instances to be added to discreet <a href="layer.htm">layers</a>, which in turn are set to a specific depth, but it may be that you want to change the depth of an instance using this value, in which case a &quot;temporary layer&quot; will be created specifically for the instance at the given depth. Note that when no instances are on the same depth then this temporary layer will be removed from memory (unlike regular layers which will remain even if they have nothing on them).</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_important.hts"> </span> When you modify the <span class="inline2"><span data-field="title" data-format="default">depth</span></span> <font face="menlo, consolas, monospace"><b> </b></font>variable and <span data-keyref="GameMaker Name">GameMaker</span> manages the layers, the built-in <span class="inline2"><span style="font-size:1px;"><a href="layer.htm"><span class="inline">layer</span></a></span></span> variable will return -1 and not the layer handle, since managed layers cannot be manipulated through code. </p>
<div data-conref="../../../../../assets/snippets/Note_Depth_Values_Are_Approximate.hts"> </div>
<p>In <span data-keyref="GameMaker Name">GameMaker</span> the lower the depth value for an instance, the &quot;closer to the camera&quot; that instance will be drawn, while a higher depth value means that the instance will be drawn &quot;further away from the camera&quot;, i.e: -1000 is drawn on top of -100, which is drawn on top of 0, and so on.</p>
<p><img alt="Depth sorting example image" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Instances/depth_image.png"/>Note that instances that have the <b>same</b> depth may be drawn <b>above <i>or</i> below one another</b> regardless of how it appears in <a data-xref="{title}" href="../../../../../The_Asset_Editors/Rooms.htm">The Room Editor</a>. This is not guaranteed to be consistent between target platforms as it will depend on the graphics device in use. If you want to guarantee that something is drawn over or under everything else, you should always set the depth (or layer) explicitly.</p>
<p>Also note that there is a minimum (<span data-keyref="Const_Depth_Min">-16000</span>) and maximum (<span data-keyref="Const_Depth_Max">16000</span>) depth value outside of which instances will not be drawn, although they will still exist and process events.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_important.hts"> </span> The minimum and maximum depth values are approximate. As a result, when you set the draw depth to a value close to these limits, what you&#39;re drawing might not be drawn.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> You <b>cannot</b> set the depth of an instance in its Draw event (all other events are fine). You can, however, set the depth at which to draw things in the Draw event using <span class="inline3_func"><a data-xref="{title}" href="../../../Drawing/GPU_Control/gpu_set_depth.htm">gpu_set_depth</a></span>.</p>
<p>Keep in mind that modifying the depth of an instance may change which <a href="../../../../../The_Asset_Editors/Room_Properties/Filters_and_Effects.htm">Filters &amp; Effects</a> are applied on it, as changing the depth to be lower than an FX layer&#39;s depth will no longer apply its effect on the instance.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">depth</span></p>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span> (single precision floating point value)</p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (y != yprevious)
<br/>
{
<br/>
depth = -y;
<br/>
}</p>
<p>The above code will check to see if the y position has changed and if it has then the depth will also be set to correspond to it.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Instance_Variables.htm">Instance Variables</a></div>
<div style="float:right">Next: <a href="layer.htm">layer</a></div>
</div>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>depth</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="Page outlining the variable depth" />
<meta name="rh-index-keywords" content="depth" />
<meta name="search-keywords" content="depth" />
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">depth</span></h1>
<p>When you create an object you can assign it an initial <i>depth</i> which defines how the instances of that object will be drawn in the room when the game is being played and this variable can be used to get and to change that depth value while the game is running. You would normally not need to use this variable as you should be setting instances to be added to discreet <a href="layer.htm">layers</a>, which in turn are set to a specific depth, but it may be that you want to change the depth of an instance using this value, in which case a &quot;temporary layer&quot; will be created specifically for the instance at the given depth. Note that when no instances are on the same depth then this temporary layer will be removed from memory (unlike regular layers which will remain even if they have nothing on them).</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_important.hts"> </span> When you modify the <span class="inline2"><span data-field="title" data-format="default">depth</span></span>
<font face="menlo, consolas, monospace"><b> </b></font>variable and <span data-keyref="GameMaker Name">GameMaker</span> manages the layers, the built-in <span class="inline2"><span style="font-size:1px;"><a href="layer.htm"><span class="inline">layer</span></a></span></span> variable will return -1 and not the layer handle, since managed layers cannot be manipulated through code.
</p>
<div data-conref="../../../../../assets/snippets/Note_Depth_Values_Are_Approximate.hts"> </div>
<p>In <span data-keyref="GameMaker Name">GameMaker</span> the lower the depth value for an instance, the &quot;closer to the camera&quot; that instance will be drawn, while a higher depth value means that the instance will be drawn &quot;further away from the camera&quot;, i.e: -1000 is drawn on top of -100, which is drawn on top of 0, and so on.</p>
<p><img alt="Depth sorting example image" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Instances/depth_image.png" />Note that instances that have the <b>same</b> depth may be drawn <b>above <i>or</i> below one another</b> regardless of how it appears in <a data-xref="{title}" href="../../../../../The_Asset_Editors/Rooms.htm">The Room Editor</a>. This is not guaranteed to be consistent between target platforms as it will depend on the graphics device in use. If you want to guarantee that something is drawn over or under everything else, you should always set the depth (or layer) explicitly.</p>
<p>Also note that there is a minimum (<span data-keyref="Const_Depth_Min">-16000</span>) and maximum (<span data-keyref="Const_Depth_Max">16000</span>) depth value outside of which instances will not be drawn, although they will still exist and process events.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_important.hts"> </span> The minimum and maximum depth values are approximate. As a result, when you set the draw depth to a value close to these limits, what you&#39;re drawing might not be drawn.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> You <b>cannot</b> set the depth of an instance in its Draw event (all other events are fine). You can, however, set the depth at which to draw things in the Draw event using <span class="inline3_func"><a data-xref="{title}" href="../../../Drawing/GPU_Control/gpu_set_depth.htm">gpu_set_depth</a></span>.</p>
<p>Keep in mind that modifying the depth of an instance may change which <a href="../../../../../The_Asset_Editors/Room_Properties/Filters_and_Effects.htm">Filters &amp; Effects</a> are applied on it, as changing the depth to be lower than an FX layer&#39;s depth will no longer apply its effect on the instance.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">depth</span></p>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span> (single precision floating point value)</p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (y != yprevious)<br />
{<br />
    depth = -y;<br />
}</p>
<p>The above code will check to see if the y position has changed and if it has then the depth will also be set to correspond to it.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Instance_Variables.htm">Instance Variables</a></div>
<div style="float:right">Next: <a href="layer.htm">layer</a></div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 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
depth
--><!-- TAGS
-->
<!-- TAGS
depth
--></body>
-->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
<?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>layer_background_destroy</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="Page outlining the function layer_background_destroy"/>
<meta name="rh-index-keywords" content="layer_background_destroy"/>
<meta name="search-keywords" content="layer_background_destroy"/>
<meta name="is_pure" content="true"/>
</head>
<body><!--<div class="body-scroll" style="top: 150px;">-->
<h1>layer_background_destroy</h1>
<p>This function will destroy the given background element. You supply the background ID (which you get when you create the background using <a href="layer_background_create.htm"><span class="inline">layer_background_create()</span></a> or when you use the layer handle along with <a href="layer_background_get_id.htm"><span class="inline">layer_get_background_id()</span></a>) and this will remove it. Note that this does <i>not</i> remove the layer, only the background from it, and if the background is one that has been added in the room editor, then the next time you leave the room and then return, the background will be recreated again. However if the room is persistent, the background will be removed unless room persistence is switched off again.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">layer_background_destroy(background_element_id)</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>background_element_id</td>
<td><span data-keyref="Type_ID_Element_Background">Background Element ID</span></td>
<td>The unique ID value of the background element to be destroyed</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">var lay_id = layer_get_id(&quot;Background_trees&quot;);
<br/>
var bck_id = layer_background_get_id(&quot;Forrest&quot;);
<br/>
if (layer_background_exists(lay_id, bck_id))
<br/>
{
<br/>
layer_background_destroy(bck_id);
<br/>
}</p>
<p>The above code checks the layer &quot;Background_trees&quot; to see if the given background element exists and if it does, then it is destroyed (but not the layer).</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Background_Layers.htm">Background Layers</a></div>
<div style="float:right">Next: <a href="layer_background_visible.htm">layer_background_visible</a></div>
</div>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_background_destroy</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="Page outlining the function layer_background_destroy" />
<meta name="rh-index-keywords" content="layer_background_destroy" />
<meta name="search-keywords" content="layer_background_destroy" />
<meta name="is_pure" content="true" />
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>layer_background_destroy</h1>
<p>This function will destroy the given background element. You supply the background ID (which you get when you create the background using <a href="layer_background_create.htm"><span class="inline">layer_background_create()</span></a> or when you use the layer handle along with <a href="layer_background_get_id.htm"><span class="inline">layer_get_background_id()</span></a>) and this will remove it. Note that this does <i>not</i> remove the layer, only the background from it, and if the background is one that has been added in the room editor, then the next time you leave the room and then return, the background will be recreated again. However if the room is persistent, the background will be removed unless room persistence is switched off again.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">layer_background_destroy(background_element_id)</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>background_element_id</td>
<td><span data-keyref="Type_ID_Element_Background"><a href="layer_background_get_id.htm" target="_blank">Background Element ID</a></span></td>
<td>The unique ID value of the background element to be destroyed</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">var lay_id = layer_get_id(&quot;Background_trees&quot;);<br />
var bck_id = layer_background_get_id(&quot;Forrest&quot;);<br />
<br />
if (layer_background_exists(lay_id, bck_id))<br />
{<br />
    layer_background_destroy(bck_id);<br />
}
</p>
<p>The above code checks the layer &quot;Background_trees&quot; to see if the given background element exists and if it does, then it is destroyed (but not the layer).</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Background_Layers.htm">Background Layers</a></div>
<div style="float:right">Next: <a href="layer_background_visible.htm">layer_background_visible</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
layer_background_destroy
--><!-- TAGS
-->
<!-- TAGS
layer_background_destroy
--></body>
-->
</body>
</html>
Loading

0 comments on commit 8e3f441

Please sign in to comment.