From 6c2672b2858185b3d395e99592558528d87d97f1 Mon Sep 17 00:00:00 2001 From: gurpreetsinghmatharoo Date: Mon, 26 Aug 2024 11:41:07 +0530 Subject: [PATCH 01/10] docs(general): Document that draw_sprite_general gradients will not seamlessly span the whole rectangle https://github.com/YoYoGames/GameMaker-Bugs/issues/7394 --- .../Sprites_And_Tiles/draw_sprite_general.htm | 44 +++++++++--------- .../Drawing/draw_sprite_general_quirk.png | Bin 0 -> 2467 bytes 2 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 Manual/contents/assets/Images/Scripting_Reference/GML/Reference/Drawing/draw_sprite_general_quirk.png diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Sprites_And_Tiles/draw_sprite_general.htm b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Sprites_And_Tiles/draw_sprite_general.htm index 56c93cbd5..339a2e151 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Sprites_And_Tiles/draw_sprite_general.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Sprites_And_Tiles/draw_sprite_general.htm @@ -4,7 +4,7 @@ draw_sprite_general - + @@ -17,9 +17,11 @@

draw_sprite_general

This function combines the function draw_sprite_ext() with the function draw_sprite_part(), adding in some additional blending options so that each corner of the final sprite part can be blended with an individual colour.

-

NOTE: Colour blending is only recommended for the HTML5 target when WebGL is enabled, although you can still set the blending colour if it is not enabled and it will blend the sprite as normal. However all blending in this way creates a duplicate sprite which is then stored in the cache and used when required. This is far from optimal and if you use multiple colour changes it will slow down your games performance unless you activate WebGL. if you do not wish to use WebGL, then you can set the font cache size to try and limit this should it be necessary using the function sprite_set_cache_size().

-

NOTE: This function may not work as expected when using skeleton animation sprites, and you may find that the function only draws the first frame of the default pose. You should be using the draw_skeleton_* functions instead.

-

NOTE: When drawing with this function, the sprite x offset and y offset are ignored and the sprite part will be drawn with the top left corner at the specified x / y position in the room.

+

Note that applying colours to corners may not look exactly as you expect due to how sprites are drawn. See the following example, where the image on the left is drawn with a different bottom-left colour, and the image on the right is drawn with a different bottom-right colour:

+

In each image the gradients do not seamlessly span the whole rectangle and instead seem to be split into halves. This is due to a rectangle actually being made up of two triangles, where the corner colours supplied into this function are applied to each vertex of the two triangles (hence 6 vertices at 3 per triangle). This causes the colours between the vertices to be interpolated for each triangle separately.

+

Colour blending is only recommended for the HTML5 target when WebGL is enabled, although you can still set the blending colour if it is not enabled and it will blend the sprite as normal. However all blending in this way creates a duplicate sprite which is then stored in the cache and used when required. This is far from optimal and if you use multiple colour changes it will slow down your games performance unless you activate WebGL. If you do not wish to use WebGL, then you can set the sprite cache size to try and limit this should it be necessary using the function sprite_set_cache_size().

+

This function may not work as expected when using skeleton animation sprites, and you may find that the function only draws the first frame of the default pose. You should be using the draw_skeleton_* functions instead.

+

When drawing with this function, the sprite x offset and y offset are ignored and the sprite part will be drawn with the top left corner at the specified x / y position in the room.

 

Syntax:

draw_sprite_general(sprite, subimg, left, top, width, height, x, y, xscale, yscale, rot, c1, c2, c3, c4, alpha);

@@ -32,82 +34,82 @@

Syntax:

sprite - Sprite Asset + Sprite Asset The index of the sprite to draw. subimg - Real + Real The subimg (frame) of the sprite to draw (image_index or -1 correlate to the current frame of animation in the object). left - Real + Real The x position on the sprite of the top left corner of the area to draw. top - Real + Real The y position on the sprite of the top left corner of the area to draw. width - Real + Real The width of the area to draw. height - Real + Real The height of the area to draw. x - Real + Real The x coordinate of where to draw the sprite. y - Real + Real The y coordinate of where to draw the sprite. xscale - Real + Real The horizontal scaling of the sprite, as a multiplier: 1 = normal scaling, 0.5 is half etc... yscale - Real + Real The vertical scaling of the sprite, as a multiplier: 1 = normal scaling, 0.5 is half etc... rot - Real + Real The rotation of the sprite. 0=normal, 90=turned 90 degrees counter-clockwise etc. c1 - Colour + Colour The colour with which to blend the top left area of the sprite. c2 - Colour + Colour The colour with which to blend the top right area of the sprite. c3 - Colour + Colour The colour with which to blend the bottom right area of the sprite. c4 - Colour + Colour The colour with which to blend the bottom left area of the sprite. alpha - Real + Real The alpha of the sprite (from 0 to 1 where 0 is transparent and 1 opaque). @@ -129,7 +131,7 @@

Example:

Next: draw_sprite_part
-
© Copyright YoYo Games Ltd. 2023 All Rights Reserved
+
© Copyright YoYo Games Ltd. 2024 All Rights Reserved
From 806622238c12b6d3a1669f150f6934532ba8b6e6 Mon Sep 17 00:00:00 2001 From: gurpreetsinghmatharoo Date: Tue, 27 Aug 2024 09:30:19 +0530 Subject: [PATCH 03/10] docs(feature): GMRT/GMPM docs improvements https://github.com/YoYoGames/YoYoStudio/issues/10363 --- Manual/contents/IDE_Tools/Project_Tool.htm | 2 +- .../IDE_Preferences/Sequences_Preferences.htm | 6 +++--- Manual/contents/Settings/Runner_Details/Runner_Details.htm | 3 ++- Manual/contents/Settings/YoYo_Compiler.htm | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Manual/contents/IDE_Tools/Project_Tool.htm b/Manual/contents/IDE_Tools/Project_Tool.htm index b2ca678ac..f6e4f3e4b 100644 --- a/Manual/contents/IDE_Tools/Project_Tool.htm +++ b/Manual/contents/IDE_Tools/Project_Tool.htm @@ -45,7 +45,7 @@

Project Tool O

diff --git a/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/Sequences_Preferences.htm b/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/Sequences_Preferences.htm index 4390306ea..cbc97c590 100644 --- a/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/Sequences_Preferences.htm +++ b/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/Sequences_Preferences.htm @@ -4,7 +4,7 @@ Sequences Preferences - + @@ -57,10 +57,10 @@

Sequences Preferences

-
© Copyright YoYo Games Ltd. 2023 All Rights Reserved
+
© Copyright YoYo Games Ltd. 2024 All Rights Reserved

Particle Types

Particles are the graphic effects that can be created by the use of particle systems in a game. The particles that you define using these functions can be used in any system that you create and the normal procedure would be to define all your particles once at the start of a game and store their index values in global variables. These global variables can then be used to burst, emit or create particles at any time throughout the game. You can also create, use and then destroy particles as needed if memory is an issue or if you wish many different types but only at specific points in your game. Whatever you choose, particles are a very versatile resource!

+

Particle types, unlike emitters, are not tied to particle systems and so destroying any systems making use of particle types will not destroy those types.

 Some particle properties have an *_incr and *_wiggle parameter; changing these will affect existing particles of the given particle type. This gives you a limited way to influence existing particles in a particle system.

 

From 2808be95aaaba834a7f59b073167c5f1901696b3 Mon Sep 17 00:00:00 2001 From: gurpreetsinghmatharoo Date: Tue, 27 Aug 2024 11:50:21 +0530 Subject: [PATCH 06/10] docs(general): Document the data types that are and aren't supported by the ds_read/ds_write functions MAN-795 --- .../GML_Reference/Data_Structures/DS_Maps/ds_map_write.htm | 7 ++++--- .../File_Handling/Encoding_And_Hashing/json_decode.htm | 2 +- .../File_Handling/Encoding_And_Hashing/json_encode.htm | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/ds_map_write.htm b/Manual/contents/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/ds_map_write.htm index 869c0f765..b6d732b36 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/ds_map_write.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/ds_map_write.htm @@ -17,6 +17,7 @@

ds_map_write

This function will turn the DS map data of the specified map into string format which can then be written to an *.ini or a *.txt file for easy storage. This string can then be later read back into a new ds_map using ds_map_read().

+

Within the DS map any Real, String and Array values (including arrays nested within arrays) will be stored into the string properly, however structs are not supported.

 

Syntax:

@@ -30,14 +31,14 @@

Syntax:

id - DS Map ID + DS Map The id of the data structure to use

 

Returns:

-

String

+

String

 

Example:

ini_open("map.ini");
@@ -56,7 +57,7 @@

Example:

Next: ds_map_destroy
-
© Copyright YoYo Games Ltd. 2023 All Rights Reserved
+
© Copyright YoYo Games Ltd. 2024 All Rights Reserved

json_encode

This function takes an existing DS Map and encodes it as a JSON string. The JSON string can be used, e.g., as part of an http_post_string call or be written to a file, so the data can be stored externally.

-

 This function - while still valid - has been superseded by the function json_stringify, and we recommend that you only use this function for legacy support.

+

 This function - while still valid for DS maps - has been superseded by the function json_stringify and structs, and we recommend that you only use this function for legacy support.

The DS map can contain the following: 

Usage Notes

@@ -95,7 +95,7 @@

Example 2: Hierarchy of Mixed Data Types

Next: json_encode
-
© Copyright YoYo Games Ltd. 2023 All Rights Reserved
+
© Copyright YoYo Games Ltd. 2024 All Rights Reserved

texture_flush

This function can be used to "flush" a texture page or a group of texture pages, i.e.: remove them from VRAM when no longer required. The textures stay in RAM.

-

You supply the unique texture page ID (as returned by the texturegroup_* functions) to flush a single page, or you can supply a texture group name (as defined in the Texture Group Editor) to flush all the texture pages in the group.

+

You supply the unique texture page ID (as found in the array from texturegroup_get_textures) to flush a single page, or you can supply a texture group name (as defined in the Texture Group Editor) to flush all the texture pages in the group.

 

Syntax:

texture_flush(tex_id);

@@ -54,7 +54,7 @@

Example:

Next: texture_debug_messages
-
© Copyright YoYo Games Ltd. 2023 All Rights Reserved
+
© Copyright YoYo Games Ltd. 2024 All Rights Reserved

texture_is_ready

This function can be used to check if a specific texture page has been unpacked and is ready for use, or if a group of texture pages have been unpacked and are ready for use.

-

You supply the unique texture page ID (as returned by the texturegroup_* functions) or the texture group ID string (as defined in the Texture Group Editor), and the function will return true if they have been unpacked, or false otherwise.

+

You supply the unique texture page ID (as found in the array from texturegroup_get_textures) or the texture group ID string (as defined in the Texture Group Editor), and the function will return true if they have been unpacked, or false otherwise.

 

Syntax:

texture_is_ready(tex_id);

@@ -58,7 +58,7 @@

Example:

Next: texturegroup_get_textures
-
© Copyright YoYo Games Ltd. 2023 All Rights Reserved
+
© Copyright YoYo Games Ltd. 2024 All Rights Reserved

texture_prefetch

This function can be used to "prefetch" a texture page or a group of texture pages, i.e.: load them into VRAM when required.

-

You supply the unique texture page ID (as returned by the texturegroup_* functions) to prefetch a single page, or you can supply a texture group name (as defined in the Texture Group Editor) to prefetch all the texture pages in the group.

+

You supply the unique texture page ID (as found in the array from texturegroup_get_textures) to prefetch a single page, or you can supply a texture group name (as defined in the Texture Group Editor) to prefetch all the texture pages in the group.

 

Syntax:

diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/texture_set_stage.htm b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/texture_set_stage.htm index fae069a22..66cfda23a 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/texture_set_stage.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/texture_set_stage.htm @@ -35,7 +35,7 @@

Syntax:

tex - Texture or int64 (signed 64-bit integer) + Texture The texture to use. From d7a4dd98fd5377fdc2a0cfa71bcf185b02175fc3 Mon Sep 17 00:00:00 2001 From: gurpreetsinghmatharoo Date: Wed, 28 Aug 2024 14:21:42 +0530 Subject: [PATCH 10/10] docs(general): Objects vs Instances fix --- Manual/contents/Additional_Information/Objects_vs_Instances.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manual/contents/Additional_Information/Objects_vs_Instances.htm b/Manual/contents/Additional_Information/Objects_vs_Instances.htm index d6c98400d..7cdf8b925 100644 --- a/Manual/contents/Additional_Information/Objects_vs_Instances.htm +++ b/Manual/contents/Additional_Information/Objects_vs_Instances.htm @@ -30,7 +30,7 @@

Accessing Variables

Functions Taking Only Objects or Instances

There are built-in GML functions that operate on either an object handle or an instance handle, depending on the function.

Functions that only take an object handle usually return information on all of its instances, such as instance_number, on the object itself, such as object_get_name, and on one particular instance of the object, such as instance_nearest and instance_create_layer (in this case, creating a new one). Another example is the function instance_change which operates on the current instance and changes it to use a different object (and hence use its events).

-

Functions that only operate on instances mostly do so without arguments, as they operate on the instance executing the code. For example, instance_change as previously mentioned, instance_copymotion_add and various other functions will operate on the current instance. There are functions that operate on instances via arguments, but they also accept object handles and are covered below under Mixed Functions.

+

Functions that only operate on instances mostly do so without arguments, as they operate on the instance executing the code. For example, instance_change as previously mentioned, instance_copymotion_add and various other functions will operate on the current instance. There are functions that operate on instances via arguments, but they also accept object handles and are covered in the next section.

Functions Taking Both Objects and Instances

There are built-in GML functions that take both an instance handle and an object handle.

The difference in most use cases is simple: passing an instance handle only modifies that one instance, and passing an object handle modifies all instances of the given object.