-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from YoYoGames/develop.gurpreet
Mark SVG as beta, and package manager as non-beta
- Loading branch information
Showing
151 changed files
with
7,731 additions
and
8,008 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 53 additions & 51 deletions
104
.../GameMaker_Language/GML_Reference/Asset_Management/Instances/Instance_Variables/depth.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "temporary layer" 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 "closer to the camera" that instance will be drawn, while a higher depth value means that the instance will be drawn "further away from the camera", 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'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 & Effects</a> are applied on it, as changing the depth to be lower than an FX layer'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 "temporary layer" 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 "closer to the camera" that instance will be drawn, while a higher depth value means that the instance will be drawn "further away from the camera", 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'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 & Effects</a> are applied on it, as changing the depth to be lower than an FX layer'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> |
Oops, something went wrong.