You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sprites/Sprite_Instance_Variables/image_index.htm
if (image_index >= image_number - 1) instance_destroy();<br/>
31
+
if (image_index >= image_number - 1)<br/>
32
+
{<br/>
33
+
instance_destroy();<br/>
34
+
}<br/>
32
35
}</p>
33
36
<p>O código acima verifica se o <spanclass="notranslate">sprite</span> está animando, e se está então verifica se a imagem_index atual está no último frame e, nesse caso, destrói a instância.</p>
<p>This function returns the used size of the given buffer.</p>
19
+
<p>The used size is the number of bytes that have been written to the buffer. It starts out at 0 for a new buffer created with <spanclass="inline3_func"><adata-xref="{title}" href="buffer_create.htm">buffer_create</a></span> and increases when you write to it. It can be set manually using <spanclass="inline3_func"><adata-xref="{title}" href="buffer_set_used_size.htm">buffer_set_used_size</a></span>.</p>
<p>The above code creates a new grow buffer with an initial size of 16 bytes and then writes 6 values of type <spanclass="inline2">buffer_f32</span> to it in a <spanclass="inline2"><adata-xref="{title}" href="../../GML_Overview/Language_Features/repeat.htm">repeat</a></span> loop. Each value of this data type takes up 4 bytes in the buffer, bringing the total size to 24 bytes, which is more than the initial size of the buffer. After the writes the used size and actual size of the buffer are retrieved using <spanclass="inline3_func"><spandata-field="title" data-format="default">buffer_get_used_size</span></span> and <spanclass="inline3_func"><adata-xref="{title}" href="buffer_get_size.htm">buffer_get_size</a></span> respectively and are output in a debug message. While the used size shows the exact number of bytes written (24), the size shows a larger number of bytes, indicating that the buffer was resized to accommodate more data than was written.</p>
<p>This function attempts to revalidate a Mac App Store receipt.</p>
19
+
<p>It triggers an Async <adata-xref="{title}" href="../../../The_Asset_Editors/Object_Properties/Async_Events/System.htm">System</a> event of type <spanclass="inline2">"receipt_validation"</span>. If the receipt is valid, the <spanclass="inline2">valid</span> key in <spanclass="inline2">async_load</span> will be <spanclass="inline2">true</span>. See the example below.</p>
20
+
<pclass="note"><spandata-conref="../../../assets/snippets/Tag_note.hts"></span> The async event is automatically triggered a single time at game start.</p>
// Show debug message and keep functionality unchanged<br/>
42
+
show_debug_message("Invalid receipt - staying in demo mode");<br/>
43
+
}
44
+
</p>
45
+
<p>The above code shows a call to <spanclass="inline3_func"><spandata-field="title" data-format="default">mac_refresh_receipt_validation</span></span> in a mouse Left Pressed event - on a button object, for example - and the code of the Async <adata-xref="{title}" href="../../../The_Asset_Editors/Object_Properties/Async_Events/System.htm">System</a> event. If the event type held in the <spanclass="inline2"><adata-xref="{title}" href="../../GML_Overview/Variables/Builtin_Global_Variables/async_load.htm">async_load</a></span> map doesn't equal <spanclass="inline2">"receipt_validation"</span>, the code is exited. If it does, code execution continues and the <spanclass="inline2">"valid"</span> key is checked in an <spanclass="inline2">if</span> statement. If the receipt is valid, additional functionality is unlocked. If not, a debug message is shown and no additional functionality is unlocked.</p>
Copy file name to clipboardexpand all lines: Manual/contents/GameMaker_Language/GML_Reference/Variable_Functions/handle.htm
+1-1
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ <h4>Syntax:</h4>
43
43
</table>
44
44
<p></p>
45
45
<h4>Returns:</h4>
46
-
<pclass="code"><spandata-keyref="Type_Handle"><ahref="../../GML_Overview/Data_Types.htm" target="_blank">Handle</a></span> (or <spandata-keyref="Type_Undefined"><ahref="../../GML_Overview/Data_Types.htm" target="_blank">undefined</a></span> in case of an invalid handle type or an invalid string)</p>
46
+
<pclass="code"><spandata-keyref="Type_Handle"><ahref="../../GML_Overview/Data_Types.htm" target="_blank">Handle</a></span> (or <spandata-keyref="Type_Undefined"><ahref="../../GML_Overview/Data_Types.htm" target="_blank">undefined</a></span> in case of an invalid handle type or an incorrectly formatted string)</p>
<p>A handle can be invalid, in which case the index number it holds will be <spanclass="inline2">-1</span>, or <spanclass="inline2">-4</span> (<spanclass="inline2"><adata-xref="{title}"href="../../GameMaker_Language/GML_Overview/Instance Keywords/noone.htm">noone</a></span>) for instance handles. All handles can be compared against their "invalid" value to check whether they're valid or not (i.e. <spanclass="inline2">if (handle != -1) { // do something }</span> or <spanclass="inline2">if (handle != noone) { // execute this code in the instance }</span>).</p>
12
+
<p>A handle can be invalid, in which case the index number it holds will be <spanclass="inline2">-1</span>, or <spanclass="inline2">-4</span> (<spanclass="inline2"><adata-xref="{title}"href="../../GameMaker_Language/GML_Overview/Instance Keywords/noone.htm">noone</a></span>) for instance handles. All handles can be compared against their "invalid" value to check whether they're valid or not (i.e. <spanclass="inline2">if (handle != -1) { // do something }</span> or <spanclass="inline2">if (handle != noone) { // do something }</span>).</p>
Copy file name to clipboardexpand all lines: Manual/contents/assets/snippets/Table_Buffer_Type_Constant.hts
+4-4
Original file line number
Diff line number
Diff line change
@@ -16,27 +16,27 @@
16
16
</colgroup>
17
17
<tbody>
18
18
<tr>
19
-
<thcolspan="2"><spandata-keyref="Type_Constant_Buffer_Type"><ahref="../../../GameMaker_Language/GML_Reference/Buffers/buffer_create.htm"target="_blank">Buffer Type Constant</a></span></th>
19
+
<thcolspan="2"><spandata-keyref="Type_Constant_Buffer_Type"><ahref="../../GameMaker_Language/GML_Reference/Buffers/buffer_create.htm"target="_blank">Buffer Type Constant</a></span></th>
20
20
</tr>
21
21
<tr>
22
22
<th>Constant</th>
23
23
<th>Description</th>
24
24
</tr>
25
25
<tr>
26
26
<td><spanclass="inline">buffer_fixed</span></td>
27
-
<td>A buffer of fixed size.</td>
27
+
<td>A buffer of a fixed size in bytes. The size is set when the buffer is created and cannot be changed again.</td>
28
28
</tr>
29
29
<tr>
30
30
<td><spanclass="inline">buffer_grow</span></td>
31
-
<td>A buffer that will "grow" dynamically as data is added</td>
31
+
<td>A buffer that will <i>grow</i> dynamically as data is added. You create it with an initial size (which should be an approximation of the size of the data expected to be stored), and then it will expand to accept further data that overflows this initial size.</td>
32
32
</tr>
33
33
<tr>
34
34
<td><spanclass="inline">buffer_wrap</span></td>
35
35
<td>A buffer where the data will "wrap". When the data being added reaches the limit of the buffer size, the overwrite will be placed back at the start of the buffer, and further writing will continue from that point.</td>
36
36
</tr>
37
37
<tr>
38
38
<td><spanclass="inline">buffer_fast</span></td>
39
-
<td>A special "stripped" buffer that is extremely fast to read/write to. Can only be used with <spanclass="inline">buffer_u8</span><ahref="../../GameMaker_Language/GML_Reference/Buffers/buffer_write.htm">data types</a>, and <i>must</i> be 1 byte aligned.</td>
39
+
<td>A special "stripped" buffer that is extremely fast to read/write to. Can only be used with <spanclass="inline">buffer_u8</span><ahref="../../GameMaker_Language/GML_Reference/Buffers/buffer_write.htm">data types</a>, and <i>must</i> be 1 byte aligned.</td>
0 commit comments