Skip to content

Commit

Permalink
Merge pull request #213 from YoYoGames/develop.gurpreet
Browse files Browse the repository at this point in the history
Document new IDE updater, SVG import support
  • Loading branch information
gurpreetsinghmatharoo authored Nov 11, 2024
2 parents 1fe1015 + 4b5438f commit d36c8b5
Show file tree
Hide file tree
Showing 36 changed files with 664 additions and 443 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ <h3>Types of Scope</h3>
<li><a data-xref="{title}" href="Variables/Local_Variables.htm">Local Variables</a></li>
</ul>
<p>Scopes are not entirely separated and some scopes are always accessible from other scopes. In case of an <a href="../../The_Asset_Editors/Object_Properties/Object_Events.htm">Object Event</a> being executed, the following rules will apply:</p>
<p><img class="center" src="../../assets/Images/Scripting_Reference/GML/Overview/scopes.png" /></p>
<ul class="colour">
<li><strong>Global variables and constants</strong> are always available.</li>
<li><strong>The instance variables for the current instance</strong> are available while in the scope of that instance.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>sprite_merge</h1>
<p>This function will merge the sprite indexed in argument 1 (&quot;ind2&quot;) with that which is indexed in argument 0 (&quot;ind1&quot;). The images themselves are <b>NOT</b> merged together, but rather the image indices are merged, with the sub images from sprite &quot;ind2&quot; appended onto those of sprite &quot;ind1&quot;, ie: they are added on at the end. Note that if the sprites are different sizes, then the appended sprites are stretched to fit the image size for &quot;ind1&quot;.</p>
<p>This change is permanent, and from the moment you use this function until the game is closed or the sprite deleted, the sprite that is being merged into will be changed, however the sprite that it is being merged with will remain the same.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> Neither the image asset that is being merged into, nor the image asset that is for merging, can be one of the original game resources. You must use <span style="font-size:1px;"><a href="sprite_duplicate.htm"><span class="inline">sprite_duplicate()</span></a></span> first to create two new resources (if you are merging included game assets) and then merge those.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> This function is only useful for <b>bitmap</b> sprites and will not work with SWF or JSON (Spine) sprites.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> This function is only useful for <b>bitmap</b> sprites and will not work with vector or JSON (Spine) sprites.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">sprite_merge(ind1, ind2);</p>
Expand All @@ -31,12 +31,12 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>ind1</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></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 merge.</td>
</tr>
<tr>
<td>ind2</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></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 that ind1 is to be merged with.</td>
</tr>
</tbody>
Expand All @@ -46,14 +46,12 @@ <h4>Returns</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">
var tspr = array_create(2);<br />
<p class="code">var tspr = array_create(2);<br />
tspr[0] = sprite_add(working_directory + &quot;Sprite Assets/explode1.png&quot;, 16, true, true, 0, 0);<br />
tspr[1] = sprite_duplicate(spr_Explosion);<br />
sprite_merge(tspr[0], tspr[1]);<br />
sprite_index = t_spr[0];<br />
sprite_delete(tspr[1]);
</p>
sprite_delete(tspr[1]);</p>
<p>The above code loads a sprite into a local variable then merges it with another sprite that has been duplicated. Finally the merged sprite is assigned to the instance <span class="inline">sprite_index</span> while the loaded sprite is removed to free the memory it uses. Note that at some point after this operation, like in the Destroy or Room End events, you will also need to use <a href="sprite_delete.htm"><span class="inline">sprite_delete()</span></a> to remove the merged sprite from memory too.</p>
<p> </p>
<p> </p>
Expand All @@ -65,7 +63,7 @@ <h4>Example:</h4>
<div style="float:right">Next: <a href="sprite_create_from_surface.htm">sprite_create_from_surface</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
sprite_merge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>sprite_set_alpha_from_sprite</h1>
<p>This function uses the value/saturation of one sprite and multiplies it with the alpha of the target sprite. Ideally the sprite being used to generate the new alpha map should be grey-scale, with the white areas having an equivalent alpha value of 1 (opaque), the black areas being equivalent to alpha 0 (transparent), and the grey areas being an alpha in between 0 and 1. The sprite that you are setting the alpha of <i>cannot be a permanent resource</i>, nor can the sprite you use to set the alpha, as this will give an error. This means that you must create two completely new sprites &quot;on the fly&quot; in some way for the function to work correctly. This can be achieved by using surfaces, or by creating a sprite from the screen (the code example below shows how the effect can be achieved with surfaces).</p>
<p class="note"><b><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span></b> This function is only useful for <b>bitmap</b> sprites and will not work with SWF or JSON (Spine) sprites.</p>
<p class="note"><b><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span></b> This function is only useful for <b>bitmap</b> sprites and will not work with vector or JSON (Spine) sprites.</p>
<p>Below is an image that illustrates how this function works:</p>
<p><img alt="Sprite Set Alpha Example" class="center" src="../../../../../assets/Images/Scripting_Reference/GML/Reference/Sprites/spr_alpha.png" /></p>
<p> </p>
Expand All @@ -31,12 +31,12 @@ <h4>Syntax:</h4>
</tr>
<tr>
<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><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 change the transparency map of.</td>
</tr>
<tr>
<td>spr</td>
<td><span data-keyref="Type_Asset_Sprite"><a href="The_Asset_Editors/Sprites.htm" target="_blank">Sprite Asset</a></span></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 take the transparency map data from.</td>
</tr>
</tbody>
Expand All @@ -49,7 +49,7 @@ <h4>Extended Example:</h4>
<p>In this extended example we show how you can create a special effect sprite from two sprite resources. To start with we need to have a controller variable in the <b>Create Event</b> of the instance. This variable is to ensure that the sprite is only created once:</p>
<p class="code">spr_create = true;</p>
<p>Once that is done we need to then go to the <b>Draw Event</b> and add in this code:</p>
<p class="code">if (spr_create) <br />
<p class="code">if (spr_create)<br />
{<br />
    spr_create = false;<br />
    var _sw = sprite_get_width(spr_Explosion_Alpha);<br />
Expand Down Expand Up @@ -85,7 +85,7 @@ <h4>Extended Example:</h4>
<div style="float:right">Next: <a href="sprite_set_cache_size.htm">sprite_set_cache_size</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
sprite_set_alpha_from_sprite
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>Sprites And Tiles</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 @@ -31,11 +31,14 @@ <h1>Sprites And Tiles</h1>
<li><a href="draw_sprite_tiled_ext.htm">draw_sprite_tiled_ext</a></li>
</ul>
<p> </p>
<p>If you are using SWF format sprites, then there are also additional options for controlling the anti-aliasing used when drawing (see <a href="../../../../Settings/Texture_Information/Non-Bitmap_Sprites.htm">Importing Non-Bitmap Sprites</a> for more information on these types of sprites). Note that these functions work on a <i>global</i> level and will set the AA on all vector SWF sprites drawn after they have been called.</p>
<p>If you are using SWF or SVG format sprites, then there are also additional options for controlling the anti-aliasing used when drawing (see <a href="../../../../Settings/Texture_Information/Non-Bitmap_Sprites.htm">Importing Non-Bitmap Sprites</a> for more information on these types of sprites). Note that these functions work on a <i>global</i> level and will set the AA on all vector SWF or SVG sprites drawn after they have been called.</p>
<ul class="colour">
<li><a href="draw_enable_swf_aa.htm">draw_enable_swf_aa</a></li>
<li><a href="draw_set_swf_aa_level.htm">draw_set_swf_aa_level</a></li>
<li><a href="draw_get_swf_aa_level.htm">draw_get_swf_aa_level</a></li>
<li><a data-xref="{title}" href="draw_enable_svg_aa.htm">draw_enable_svg_aa</a></li>
<li><a data-xref="{title}" href="draw_set_svg_aa_level.htm">draw_set_svg_aa_level</a></li>
<li><a data-xref="{title}" href="draw_get_svg_aa_level.htm">draw_get_svg_aa_level</a></li>
</ul>
<p> </p>
<p>Apart from those functions listed above, there are also two special functions designed for use with skeletal animations (see <a href="../../../../Settings/Texture_Information/Non-Bitmap_Sprites.htm">Importing Non-Bitmap Sprites</a> for more information on these types of sprites, and the section <a href="../../Asset_Management/Sprites/Skeletal_Animation/Skeletal_Animation.htm">Skeletal Animations</a> for specific functions related to these types of sprites):</p>
Expand All @@ -61,7 +64,7 @@ <h1>Sprites And Tiles</h1>
<div style="float:right">Next: <a href="../Text/Text.htm">Text</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
Sprites And Tiles
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?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>draw_enable_svg_aa</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="Reference page for draw_enable_svg_aa" />
<meta name="rh-index-keywords" content="draw_enable_svg_aa" />
<meta name="search-keywords" content="draw_enable_svg_aa" />
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">draw_enable_svg_aa</span></h1>
<p>With this function you can enable or disable anti-aliasing (AA) for SVG format vector sprites. AA simply smooths the edges of vector images to give them a nicer look. The amount of AA used will depend on the value set using the function <span class="inline3_func"><a data-xref="{title}" href="draw_set_svg_aa_level.htm">draw_set_svg_aa_level</a></span>. By default this is disabled.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">draw_enable_svg_aa</span>(enable);</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>enable</td>
<td><span data-keyref="Type_Bool"><a href="../../../GML_Overview/Data_Types.htm" target="_blank">Boolean</a></span></td>
<td>Enable (<span class="inline">true</span>) or disable (<span class="inline">false</span>) AA for all SVG sprites.</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">if (draw_get_svg_aa_level() == 0)<br />
{<br />
    draw_enable_svg_aa(true);<br />
    draw_set_svg_aa_level(0.5);<br />
}</p>
<p>The above code will check the AA value for SVG format sprites, and if it is 0 it enables AA and sets the value to 0.5.</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Sprites_And_Tiles.htm">Sprites And Tiles</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="draw_set_svg_aa_level.htm">draw_set_svg_aa_level</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
draw_enable_svg_aa
-->
<!-- TAGS
draw_enable_svg_aa
-->
</body>
</html>
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>draw_enable_swf_aa</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,28 +15,30 @@
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>draw_enable_swf_aa</h1>
<p>With this function you can enable or disable anti-aliasing (AA) for SWF format vector sprites. AA simply smooths the edges of vector images to give them a nicer look. The amount of AA used will depend on the value set using the function <a href="draw_set_swf_aa_level.htm"><span class="inline">draw_set_swf_aa_level()</span></a>. By default this is disabled.</p>
<p>With this function you can enable or disable anti-aliasing (AA) for SWF format vector sprites. AA simply smooths the edges of vector images to give them a nicer look. The amount of AA used will depend on the value set using the function <span class="inline3_func"><a data-xref="{title}" href="draw_set_swf_aa_level.htm">draw_set_swf_aa_level</a></span>. By default this is disabled.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">draw_enable_swf_aa(enable);</p>
<table>
<tbody>
<tr>
<th>Argument</th><th>Type</th>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</tr>
<tr>
<td>enable</td><td><span data-keyref="Type_Bool"></span></td>
<td>enable</td>
<td><span data-keyref="Type_Bool"><a href="../../../GML_Overview/Data_Types.htm" target="_blank">Boolean</a></span></td>
<td>Enable (<span class="inline">true</span>) or disable (<span class="inline">false</span>) AA for all SWF sprites.</td>
</tr>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void"></span></p>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (draw_get_swf_aa_level() == 0) <br />
<p class="code">if (draw_get_swf_aa_level() == 0)<br />
{<br />
    draw_enable_swf_aa(true);<br />
    draw_set_swf_aa_level(0.5);<br />
Expand All @@ -52,7 +54,7 @@ <h4>Example:</h4>
<div style="float:right">Next: <a href="draw_set_swf_aa_level.htm">draw_set_swf_aa_level</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
draw_enable_swf_aa
Expand Down
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>draw_get_svg_aa_level</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="Reference page for draw_get_svg_aa_level" />
<meta name="rh-index-keywords" content="draw_get_svg_aa_level" />
<meta name="search-keywords" content="draw_get_svg_aa_level" />
<meta name="is_pure" content="true" />
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">draw_get_svg_aa_level</span></h1>
<p>This function can be used to get the anti-aliasing (AA) level for SVG format vector sprites. The return value will between 0 and 1 and shows how &quot;smooth&quot; the edges of these sprites will be drawn. You can set the AA level using the function <span class="inline3_func"><a data-xref="{title}" href="draw_set_svg_aa_level.htm">draw_set_svg_aa_level</a></span>.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">draw_get_svg_aa_level</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></p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (draw_get_svg_aa_level() == 0)<br />
{<br />
    draw_enable_svg_aa(true);<br />
    draw_set_svg_aa_level(0.5);<br />
}</p>
<p>The above code will check the AA value for SVG format sprites, and if it is 0 it enables AA and sets the value to 0.5.</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Sprites_And_Tiles.htm">Sprites And Tiles</a></div>
<div style="float:right">Next: <a href="draw_tile.htm">draw_tile</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
draw_get_svg_aa_level
-->
<!-- TAGS
draw_get_svg_aa_level
-->
</body>
</html>
Loading

0 comments on commit d36c8b5

Please sign in to comment.