-
Notifications
You must be signed in to change notification settings - Fork 13
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 #175 from YoYoGames/develop.gurpreet
Doc tasks for 2024.11 and general fixes
- Loading branch information
Showing
23 changed files
with
560 additions
and
282 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
52 changes: 52 additions & 0 deletions
52
Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/all.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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?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>all</title> | ||
<meta name="generator" content="Adobe RoboHelp 2022" /> | ||
<link rel="stylesheet" type="text/css" href="../../../assets/css/default.css" /> | ||
<script src="../../../assets/scripts/main_script.js" type="module"></script> | ||
<meta name="rh-authors" content="" /> | ||
<meta name="topic-comment" content="" /> | ||
<meta name="rh-index-keywords" content="all" /> | ||
<meta name="search-keywords" content="all" /> | ||
<meta name="template" content="assets/masterpages/Manual_Keyword_Page.htt" /> | ||
</head> | ||
<body> | ||
<h1><span data-field="title" data-format="default">all</span></h1> | ||
<p>This keyword is used to tell <span data-keyref="GameMaker Name">GameMaker</span> that a function is to be applied, or to check, <strong>all active instances</strong> within a room (deactivated instances will not be checked or accessed). You <b>cannot</b> use <span class="inline2">all</span> to access or set variables in other instances using the point method (see <a href="../Addressing_Variables_In_Other_Instances.htm">here</a>), but you <strong>can </strong>use it when using <span class="inline2"><a data-xref="{title}" href="../Language_Features/with.htm">with</a></span>, for example:</p> | ||
<p class="code">with (all)<br /> | ||
{<br /> | ||
speed = 0;<br /> | ||
}</p> | ||
<p>The above code will set the speed of all instances in the room to 0. You can also use <span class="inline2">all</span> within functions to target or check all instances in the room for example:</p> | ||
<p class="code">// Check a point for any active instance in the room<br /> | ||
inst = instance_position(mouse_x, mouse_y, all);<br /> | ||
<br /> | ||
// Check all instances for a collision along a line<br /> | ||
if collision_line(x, y, mouse_x, mouse_y, all, false, true) {}<br /> | ||
<br /> | ||
// Add all instances in the room into a motion planning grid<br /> | ||
mp_grid_add_instances(grid, all, false); | ||
</p> | ||
<p><span class="inline2">all</span> is a very useful keyword and can be used in numerous situations within your code and actions, often cutting down on the amount of code you need to write to achieve a desired effect.</p> | ||
<p> </p> | ||
<p> </p> | ||
<div class="footer"> | ||
<div class="buttons"> | ||
<div class="clear"> | ||
<div>Back: <a data-xref="{title}" href="../Instance_Keywords.htm">Instance Keywords</a></div> | ||
<div>Next: <a data-xref="{title}" href="noone.htm">noone</a></div> | ||
</div> | ||
</div> | ||
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5> | ||
</div> | ||
<!-- KEYWORDS | ||
all | ||
--> | ||
<!-- TAGS | ||
all | ||
--> | ||
</body> | ||
</html> |
53 changes: 53 additions & 0 deletions
53
Manual/contents/GameMaker_Language/GML_Overview/Instance Keywords/noone.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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?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>noone</title> | ||
<meta name="generator" content="Adobe RoboHelp 2022" /> | ||
<link rel="stylesheet" type="text/css" href="../../../assets/css/default.css" /> | ||
<script src="../../../assets/scripts/main_script.js" type="module"></script> | ||
<meta name="rh-authors" content="" /> | ||
<meta name="topic-comment" content="" /> | ||
<meta name="rh-index-keywords" content="noone" /> | ||
<meta name="search-keywords" content="noone" /> | ||
<meta name="template" content="assets/masterpages/Manual_Keyword_Page.htt" /> | ||
</head> | ||
<body> | ||
<h1><span data-field="title" data-format="default">noone</span></h1> | ||
<p>It may seem odd, but many times while programming your games will you find the need to check if there are <strong>no instances</strong> found at a location, in a collision, etc. In those cases you would use this keyword to check for nothing, something like this:</p> | ||
<p class="code">if (instance_nearest(x, y, obj_enemy) != noone)<br /> | ||
{<br /> | ||
//do something as there is an enemy instance near<br /> | ||
}</p> | ||
<p>In this example, the function <span class="inline3_func"><a data-xref="{title}" href="../../GML_Reference/Asset_Management/Instances/instance_nearest.htm">instance_nearest</a></span> will return either <span class="inline2" id="">noone</span> or the nearest found instance. Basically, any time that you need to check for an instance, you can expect to get either <span class="inline2" id="">noone</span> or an instance returned.</p> | ||
<p>This can also be useful in combination with a <span class="inline2"><a data-xref="{title}" href="../Language_Features/with.htm">with</a></span> statement: </p> | ||
<p class="code">with (instance_nearest(x, y, obj_enemy))<br /> | ||
{<br /> | ||
//do something as there is an enemy instance near<br /> | ||
}</p> | ||
<p>If the function returns an instance, the code between the curly braces <span class="inline2">{ }</span> will run once. If the function returns <span class="inline2">noone</span>, the code won't be executed.</p> | ||
<p>You can also assign <span class="inline2">noone</span> as a value to a variable to store the result of such a function: </p> | ||
<p class="code_heading">Create Event</p> | ||
<p class="code">ins_last_collided_with = noone;</p> | ||
<p class="code_heading">Collision Event</p> | ||
<p class="code">ins_last_collided_with = other.id;</p> | ||
<p> </p> | ||
<p> </p> | ||
<div class="footer"> | ||
<div class="buttons"> | ||
<div class="clear"> | ||
<div>Back: <a data-xref="{title}" href="../Instance_Keywords.htm">Instance Keywords</a></div> | ||
<div>Next: <a data-xref="{title}" href="self.htm">self</a></div> | ||
</div> | ||
</div> | ||
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5> | ||
</div> | ||
<!-- KEYWORDS | ||
noone | ||
--> | ||
<!-- TAGS | ||
noone | ||
--> | ||
</body> | ||
</html> |
Oops, something went wrong.