Skip to content

Commit

Permalink
Merge pull request #175 from YoYoGames/develop.gurpreet
Browse files Browse the repository at this point in the history
Doc tasks for 2024.11 and general fixes
  • Loading branch information
gurpreetsinghmatharoo authored Sep 20, 2024
2 parents 1351561 + 092e829 commit 3bce1eb
Show file tree
Hide file tree
Showing 23 changed files with 560 additions and 282 deletions.
20 changes: 10 additions & 10 deletions Manual/contents/Additional_Information/Guide_To_Using_Shaders.htm
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>Guide To Using Shaders</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 Down Expand Up @@ -48,20 +48,20 @@ <h2>Shader Variables</h2>
// A 3D vector using 1 component of a vec4 plus a vec2 to create the 3 values<br />
vec3 thirdVec  = vec3(secondVec.x, firstVec);</p>
<p>We can also assign them another vector of the same length (or <em>swizzle </em>the vector until it has the proper length, but we&#39;ll explain that in a moment):</p>
<p class="code">vec3 firstVec;<br />
vec3 secondVec = firstVec;<br />
vec4 thirdVec  = secondVec.xyz;<br />
<p class="code">vec4 firstVec = vec4(0.0, 1.0, 2.0, 3.0);<br />
vec4 secondVec = firstVec;<br />
vec3 thirdVec  = secondVec.xyz;<br />
vec2 fourthVec = thirdVec.zx;</p>
<p>When accessing vector components in GLSL, we have a few options. The most basic one is to treat the vector as an array and access the components using square brackets, like this:</p>
<p class="code">vec4 myVec;<br />
myVec[0] = 1.0;<br />
myVec[1] = 0.0;<br />
myVec[0] = 0.0;<br />
myVec[1] = 1.0;<br />
myVec[2] = 2.0;<br />
myVec[3] = 1.0;</p>
myVec[3] = 3.0;</p>
<p>However, there is another way to access the components with the following syntax:</p>
<p class="code">vec4 myVec;<br />
myVec.x = 1.0;<br />
myVec.y = 2.0;</p>
myVec.x = 0.0;<br />
myVec.y = 1.0;</p>
<p>This uses the component names inside the vector to access them. You can use x, y, z, or w, to get the first, second, third, or fourth components, respectively. We refer to this method as <strong>swizzling </strong>because the following syntax is also valid:</p>
<p class="code">vec4 firstVec;<br />
vec3 secondVec = firstVec.xyz;<br />
Expand Down Expand Up @@ -394,7 +394,7 @@ <h2>Creating A Shader</h2>
<div style="float:right">Next: <a href="Guide_To_Primitives_And_Vertex_Building.htm">Guide To Primitives And Vertex Building</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
Shaders
Expand Down
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>
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&#39;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>
Loading

0 comments on commit 3bce1eb

Please sign in to comment.