Skip to content

Commit

Permalink
docs(general): sprite_get_bbox_left() page code example has left and …
Browse files Browse the repository at this point in the history
…right values the wrong way around

YoYoGames/GameMaker-Bugs#8430

* Moved the code example to a RH snippet and fixed the issue
* Inserted the snippet on all sprite_get_bbox_* pages (examples on other pages had the same mistake)
* Slight update of sprite_get_bbox_mode() page
  • Loading branch information
YYBartT committed Nov 20, 2024
1 parent 5b0a3b4 commit 7ebc5df
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 78 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>sprite_get_bbox_bottom</title>
<meta name="generator" content="Adobe RoboHelp 2019" />
<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 @@ -15,42 +15,42 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>sprite_get_bbox_bottom</h1>
<p>This function returns the relative position of the bottom of the sprite bounding box. This value is given as a relative value based on the upper left corner of the base sprite asset being (0,0). it is the same value as can be found in the sprite editor
for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<h1><span data-field="title" data-format="default">sprite_get_bbox_bottom</span></h1>
<p>This function returns the relative position of the bottom of the sprite bounding box.</p>
<p>This value is given as a relative value based on the upper left corner of the base sprite asset being (0, 0). it is the same value as can be found in the Sprite Editor for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<p><img alt="BBox Example" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Sprites/spr_bbox.png" /></p>
<h4>Syntax:</h4>
<p class="code">sprite_get_bbox_bottom(ind);</p>
<p class="code"><span data-field="title" data-format="default">sprite_get_bbox_bottom</span>(ind);</p>
<table>
<tbody>
<tr>
<th>Argument</th><th>Type</th>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</tr>
<tr>
<td>ind</td><td><span data-keyref="Type_Asset_Sprite"></span></td>
<td>ind</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="../../../../../The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></td>
<td>The index of the sprite to check.</td>
</tr>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns</h4>
<p class="code"><span data-keyref="Type_Real"></span></p>
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var ww, hh;<br/> ww = sprite_get_bbox_left(sprite_index) - sprite_get_bbox_right(sprite_index);<br/> hh = sprite_get_bbox_bottom(sprite_index) - sprite_get_bbox_top(sprite_index);</p>
<p>The above code calculates the width and height of the collision mask based on the relative bounding box side positions.</p>
<p> </p>
<div data-conref="../../../../../assets/snippets/Example_BBox_Calculation.hts"> </div>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a href="sprite_get_bbox_left.htm">sprite_get_bbox_left</a></div>
<div style="float:left">Back: <a data-xref="{title}" href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="sprite_get_bbox_left.htm">sprite_get_bbox_left</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
sprite_get_bbox_bottom
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>sprite_get_bbox_left</title>
<meta name="generator" content="Adobe RoboHelp 2019" />
<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 @@ -15,42 +15,42 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>sprite_get_bbox_left</h1>
<p>This function returns the relative position of the left of the sprite bounding box. This value is given as a relative value based on the upper left corner of the base sprite asset being (0,0). it is the same value as can be found in the sprite editor
for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<h1><span data-field="title" data-format="default">sprite_get_bbox_left</span></h1>
<p>This function returns the relative position of the left of the sprite bounding box.</p>
<p>The value is given as a relative value based on the upper left corner of the base sprite asset being (0, 0). it is the same value as can be found in the Sprite Editor for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<p><img alt="BBox Example" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Sprites/spr_bbox.png" /></p>
<h4>Syntax:</h4>
<p class="code">sprite_get_bbox_left(ind);</p>
<p class="code"><span data-field="title" data-format="default">sprite_get_bbox_left</span>(ind);</p>
<table>
<tbody>
<tr>
<th>Argument</th><th>Type</th>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</tr>
<tr>
<td>ind</td><td><span data-keyref="Type_Asset_Sprite"></span></td>
<td>ind</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="../../../../../The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></td>
<td>The index of the sprite to check.</td>
</tr>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns</h4>
<p class="code"><span data-keyref="Type_Real"></span></p>
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var ww, hh;<br/> ww = sprite_get_bbox_left(sprite_index) - sprite_get_bbox_right(sprite_index);<br/> hh = sprite_get_bbox_bottom(sprite_index) - sprite_get_bbox_top(sprite_index);</p>
<p>The above code calculates the width and height of the collision mask based on the relative bounding box side positions.</p>
<p> </p>
<div data-conref="../../../../../assets/snippets/Example_BBox_Calculation.hts"> </div>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a href="sprite_get_bbox_right.htm">sprite_get_bbox_right</a></div>
<div style="float:left">Back: <a data-xref="{title}" href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="sprite_get_bbox_right.htm">sprite_get_bbox_right</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
sprite_get_bbox_left
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>sprite_get_bbox_mode</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 @@ -15,26 +15,28 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>sprite_get_bbox_mode</h1>
<h1><span data-field="title" data-format="default">sprite_get_bbox_mode</span></h1>
<p>This function will return the current &quot;mode&quot; for the bounding box calculations. You supply the sprite index of the sprite to check, and the function will return one of the constants shown below.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">sprite_get_bbox_mode(ind);</p>
<p class="code"><span data-field="title" data-format="default">sprite_get_bbox_mode</span>(ind);</p>
<table>
<tbody>
<tr>
<th>Argument</th><th>Type</th>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</tr>
<tr>
<td>ind</td><td><span data-keyref="Type_Asset_Sprite"></span></td>
<td>ind</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="../../../../../The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></td>
<td>The index of the sprite to check.</td>
</tr>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns</h4>
<p class="code"><span data-keyref="Type_Constant_Bbox_Mode">Bounding Box Mode Constant</span></p>
<p class="code"><span data-keyref="Type_Constant_Bbox_Mode"><a href="../Sprite_Manipulation/sprite_set_bbox_mode.htm" target="_blank">Bounding Box Mode Constant</a></span></p>
<table>
<tbody>
<tr>
Expand All @@ -51,28 +53,27 @@ <h4>Returns</h4>
</tr>
<tr>
<td><span class="inline">bboxmode_manual</span></td>
<td>Manual - The bounding box has been set manually to user defined values (either in the sprite editor, or using the function <a href="../Sprite_Manipulation/sprite_set_bbox.htm"><span class="inline">sprite_set_bbox()</span></a>)</td>
<td>Manual - The bounding box has been set manually to user-defined values (either in the Sprite Editor, or using the function <span class="inline3_func"><a data-xref="{title}" href="../Sprite_Manipulation/sprite_set_bbox.htm">sprite_set_bbox</a></span>)</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Example:</h4>
<p class="code">if (sprite_get_bbox_mode(sprite_index) != 0) <br />
<p class="code">if (sprite_get_bbox_mode(sprite_index) != 0)<br />
{<br />
    sprite_set_bbox_mode(sprite_index, bboxmode_automatic);<br />
}</p>
<p>The above checks the bbox mode for the current sprite and if it&#39;s not <span class="inline">automatic</span>, then it is sets it to that value.</p>
<p> </p>
<p>The above checks the bbox mode for the current sprite and, if it&#39;s not <span class="inline2">automatic</span>, sets it to that value.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a href="sprite_get_nineslice.htm">sprite_get_nineslice</a></div>
<div style="float:left">Back: <a data-xref="{title}" href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="sprite_get_nineslice.htm">sprite_get_nineslice</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
sprite_get_bbox_mode
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>sprite_get_bbox_right</title>
<meta name="generator" content="Adobe RoboHelp 2019" />
<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 @@ -15,42 +15,45 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>sprite_get_bbox_right</h1>
<p>This function returns the relative position of the right of the sprite bounding box. This value is given as a relative value based on the upper left corner of the base sprite asset being (0,0). it is the same value as can be found in the sprite editor
for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<h1><span data-field="title" data-format="default">sprite_get_bbox_right</span></h1>
<p>This function returns the relative position of the right of the sprite bounding box.</p>
<p>This value is given as a relative value based on the upper left corner of the base sprite asset being (0, 0). it is the same value as can be found in the Sprite Editor for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<p><img alt="BBox Example" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Sprites/spr_bbox.png" /></p>
<h4>Syntax:</h4>
<p class="code">sprite_get_bbox_right(ind);</p>
<p class="code"><span data-field="title" data-format="default">sprite_get_bbox_right</span>(ind);</p>
<table>
<tbody>
<tr>
<th>Argument</th><th>Type</th>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</tr>
<tr>
<td>ind</td><td><span data-keyref="Type_Asset_Sprite"></span></td>
<td>ind</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="../../../../../The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></td>
<td>The index of the sprite to check.</td>
</tr>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns</h4>
<p class="code"><span data-keyref="Type_Real"></span></p>
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var ww, hh;<br/> ww = sprite_get_bbox_left(sprite_index) - sprite_get_bbox_right(sprite_index);<br/> hh = sprite_get_bbox_bottom(sprite_index) - sprite_get_bbox_top(sprite_index);</p>
<p class="code">var _ww, _hh;<br />
_ww = sprite_get_bbox_right(sprite_index) - sprite_get_bbox_left(sprite_index);<br />
_hh = sprite_get_bbox_bottom(sprite_index) - sprite_get_bbox_top(sprite_index);</p>
<p>The above code calculates the width and height of the collision mask based on the relative bounding box side positions.</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a href="sprite_get_bbox_top.htm">sprite_get_bbox_top</a></div>
<div style="float:left">Back: <a data-xref="{title}" href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="sprite_get_bbox_top.htm">sprite_get_bbox_top</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
sprite_get_bbox_right
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>sprite_get_bbox_top</title>
<meta name="generator" content="Adobe RoboHelp 2019" />
<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 @@ -15,43 +15,43 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>sprite_get_bbox_top</h1>
<p>This function returns the relative position of the top of the sprite bounding box. This value is given as a relative value based on the upper left corner of the base sprite asset being (0,0). it is the same value as can be found in the sprite editor
for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<h1><span data-field="title" data-format="default">sprite_get_bbox_top</span></h1>
<p>This function returns the relative position of the top of the sprite bounding box.</p>
<p>This value is given as a relative value based on the upper left corner of the base sprite asset being (0, 0). it is the same value as can be found in the Sprite Editor for the <a href="../../../../../The_Asset_Editors/Sprites.htm">collision mask properties</a>. The image below shows how it is calculated:</p>
<p><img alt="BBox Example" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Sprites/spr_bbox.png" /></p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">sprite_get_bbox_top(ind);</p>
<p class="code"><span data-field="title" data-format="default">sprite_get_bbox_top</span>(ind);</p>
<table>
<tbody>
<tr>
<th>Argument</th><th>Type</th>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</tr>
<tr>
<td>ind</td><td><span data-keyref="Type_Asset_Sprite"></span></td>
<td>ind</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="../../../../../The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></td>
<td>The index of the sprite to check.</td>
</tr>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns</h4>
<p class="code"><span data-keyref="Type_Real"></span></p>
<p class="code"><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var ww, hh;<br/> ww = sprite_get_bbox_left(sprite_index) - sprite_get_bbox_right(sprite_index);<br/> hh = sprite_get_bbox_bottom(sprite_index) - sprite_get_bbox_top(sprite_index);</p>
<p>The above code calculates the width and height of the collision mask based on the relative bounding box side positions.</p>
<p> </p>
<div data-conref="../../../../../assets/snippets/Example_BBox_Calculation.hts"> </div>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a href="sprite_get_bbox_mode.htm">sprite_get_bbox_mode</a></div>
<div style="float:left">Back: <a data-xref="{title}" href="Sprite_Information.htm">Sprite Information</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="sprite_get_bbox_mode.htm">sprite_get_bbox_mode</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
sprite_get_bbox_top
Expand Down
Loading

0 comments on commit 7ebc5df

Please sign in to comment.