From 130c0ec685f5c691ecd4131ef204365546b139f6 Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Matharoo Date: Thu, 7 Dec 2023 17:38:06 +0530 Subject: [PATCH 01/21] Update build_robohelp_gh.bat remove beta from gh build file --- build_robohelp_gh.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_robohelp_gh.bat b/build_robohelp_gh.bat index 768ee9446..6ef4f17e7 100644 --- a/build_robohelp_gh.bat +++ b/build_robohelp_gh.bat @@ -17,7 +17,7 @@ set basedir=%~dp0 :check_options if %LANGUAGE%==EN ( - set robohelpPreset="GMS2 Manual Responsive HTML5 BETA" + set robohelpPreset="GMS2 Manual Responsive HTML5" goto finish_options ) else if %LANGUAGE%==ES ( set robohelpPreset="GMS2 Manual Spanish" From 58731bce996fd9387854ef37a6beaf614d517716 Mon Sep 17 00:00:00 2001 From: suchitra Date: Thu, 7 Dec 2023 12:14:43 +0000 Subject: [PATCH 02/21] modifying batch file to work for main branch --- build_robohelp_gh.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build_robohelp_gh.bat b/build_robohelp_gh.bat index 6ef4f17e7..fde6f5425 100644 --- a/build_robohelp_gh.bat +++ b/build_robohelp_gh.bat @@ -16,9 +16,12 @@ set ZIP_FILE=%ZIP_FILE% set basedir=%~dp0 :check_options -if %LANGUAGE%==EN ( +if %LANGUAGE%==EN-BETA ( set robohelpPreset="GMS2 Manual Responsive HTML5" goto finish_options +) else if %LANGUAGE%=="" ( + set robohelpPreset="GMS2 Manual Responsive" + goto finish_options ) else if %LANGUAGE%==ES ( set robohelpPreset="GMS2 Manual Spanish" goto finish_options From 3856b0e7bac6df3a206bd961048afa2959db312e Mon Sep 17 00:00:00 2001 From: suchitra Date: Thu, 7 Dec 2023 12:17:55 +0000 Subject: [PATCH 03/21] modifying batch file to work for main branch --- .github/workflows/main.yml | 2 +- build_robohelp_gh.bat | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98025b553..12d0093f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: name: "RoboHelp" runs-on: windows-2019 env: - LANGUAGE: ${{ vars.LANGUAGE }} + LANGUAGE: ${{ vars.LANGUAGE_MAIN }} steps: - uses: aws-actions/configure-aws-credentials@v4 with: diff --git a/build_robohelp_gh.bat b/build_robohelp_gh.bat index fde6f5425..ac45d9a53 100644 --- a/build_robohelp_gh.bat +++ b/build_robohelp_gh.bat @@ -16,10 +16,10 @@ set ZIP_FILE=%ZIP_FILE% set basedir=%~dp0 :check_options -if %LANGUAGE%==EN-BETA ( +if %LANGUAGE%==EN ( set robohelpPreset="GMS2 Manual Responsive HTML5" goto finish_options -) else if %LANGUAGE%=="" ( +) else if %LANGUAGE_MAIN%==EN ( set robohelpPreset="GMS2 Manual Responsive" goto finish_options ) else if %LANGUAGE%==ES ( From 1d95ab4cd684b98e482b10ec25f2d4c44946a657 Mon Sep 17 00:00:00 2001 From: suchitra Date: Thu, 7 Dec 2023 12:21:19 +0000 Subject: [PATCH 04/21] modifying batch file to work for main branch --- build_robohelp_gh.bat | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build_robohelp_gh.bat b/build_robohelp_gh.bat index ac45d9a53..e838627ce 100644 --- a/build_robohelp_gh.bat +++ b/build_robohelp_gh.bat @@ -15,12 +15,14 @@ set ZIP_FILE=%ZIP_FILE% set basedir=%~dp0 +if %LANGUAGE_MAIN%==EN ( + set robohelpPreset="GMS2 Manual Responsive" + goto finish_options +) + :check_options if %LANGUAGE%==EN ( set robohelpPreset="GMS2 Manual Responsive HTML5" - goto finish_options -) else if %LANGUAGE_MAIN%==EN ( - set robohelpPreset="GMS2 Manual Responsive" goto finish_options ) else if %LANGUAGE%==ES ( set robohelpPreset="GMS2 Manual Spanish" From 0ba1ce6d13784de4067ef5d5f5bdb88747e8d570 Mon Sep 17 00:00:00 2001 From: suchitra Date: Thu, 7 Dec 2023 12:22:09 +0000 Subject: [PATCH 05/21] modifying batch file to work for main branch --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12d0093f9..62774f1ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: name: "RoboHelp" runs-on: windows-2019 env: - LANGUAGE: ${{ vars.LANGUAGE_MAIN }} + LANGUAGE_MAIN: ${{ vars.LANGUAGE_MAIN }} steps: - uses: aws-actions/configure-aws-credentials@v4 with: From d336834a0e6bf01abef0dd191ce787e22572fc03 Mon Sep 17 00:00:00 2001 From: suchitra Date: Tue, 12 Dec 2023 11:57:53 +0000 Subject: [PATCH 06/21] fixes for preset for main builds --- build_robohelp_gh.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_robohelp_gh.bat b/build_robohelp_gh.bat index e838627ce..967244495 100644 --- a/build_robohelp_gh.bat +++ b/build_robohelp_gh.bat @@ -16,13 +16,13 @@ set ZIP_FILE=%ZIP_FILE% set basedir=%~dp0 if %LANGUAGE_MAIN%==EN ( - set robohelpPreset="GMS2 Manual Responsive" + set robohelpPreset="GMS2 Manual Responsive HTML5" goto finish_options ) :check_options if %LANGUAGE%==EN ( - set robohelpPreset="GMS2 Manual Responsive HTML5" + set robohelpPreset="GMS2 Manual Responsive HTML5 BETA" goto finish_options ) else if %LANGUAGE%==ES ( set robohelpPreset="GMS2 Manual Spanish" From bb1219e87aacb391abf716db96c234409ef35beb Mon Sep 17 00:00:00 2001 From: YYBartT Date: Thu, 25 Apr 2024 12:11:24 +0200 Subject: [PATCH 07/21] docs(general): updated shortcuts CSS style, workspace navigation dirs set to 4 YoYoGames/GameMaker-Bugs#5595 * Updated shortcut style on the Workspaces page * Changed number of directions to 4 instead of 8 under "Workspace keyboard navigation degree range" on Workspace Preferences page --- Manual/contents/Introduction/Workspaces.htm | 23 ++++++++++--------- .../IDE_Preferences/General/Workspace.htm | 16 ++++--------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/Manual/contents/Introduction/Workspaces.htm b/Manual/contents/Introduction/Workspaces.htm index 9fd427ece..c51edca57 100644 --- a/Manual/contents/Introduction/Workspaces.htm +++ b/Manual/contents/Introduction/Workspaces.htm @@ -18,13 +18,14 @@

Workspaces

After logging in and starting a new project, GameMaker will take you to the initial workspace with some basic windows docked to the IDE. In general, the workspace is simply an area where you can organise the different assets for your game while you are working:

Workspaces

As you can see, the initial workspace is on a tab at the top of the screen (and you can rename it by double clicking the tab), but you can create further workspaces for the project by clicking the Add New Workspace to the side, giving you multiple possible workspaces for any single project. For example, maybe you are working on interactions between the player and several enemy objects, so you'd have the player on its own workspace and the enemy objects in another, and perhaps another workspace only to show the scripts that both use.

-

Another important feature of workspaces is that you can click LMB Icon on the tab and - still holding the mouse button LMB Icon down - drag it off of the main IDE window into its own individual window, making it very easy to organise things if you are using - for example - multiple displays. You also merge these secondary workspace windows back into the main one by dragging the tab back onto the first window. Note that although you appear to have two instances of the IDE running when you do this, they are both for the same project and you cannot have one project in one and another in the other unless you specifically open two instances of GameMaker.

+

Another important feature of workspaces is that you can click  on the tab and select Detach Workspace to open it into its own individual window that's separate from the main IDE window, making it very easy to organise things if you are using - for example - multiple displays. You also merge these secondary workspace windows back into the main one by dragging the tab back onto the first window.

+

 Although you appear to have two instances of the IDE running when you do this, they are both for the same project and you cannot have one project in one and another in the other unless you specifically open two instances of GameMaker.

When you first start GameMaker, your workspace will already be populated by a couple of windows which will be "docked" to the IDE. These are explained briefly below:

  • Output - You can also see in the image above The Output Window. There are a number of sub tabs in this window related to Source Control, Searching, and Debugging, with the initial tab being for the console/compiler output, which shows you what is happening when you are compiling a game for testing or when creating a final package for distribution. This will also show any debug messages that you choose to send from your project at runtime, and can be configured to show different quantities of information from the General Preferences. If you close the output window and wish to recover it you can use The Windows Menu.
  • -
  • Assets - On the right of the screen you can find The Asset Browser. Here is where you can create and edit the different assets that your game uses, as well as generate and change configurations, game options, room order and other things. Assets are created by right-clicking Icon RMB on an asset folder (or anywhere in the main Asset Browser view) and selecting Create, or by clicking the plus icon at the top and selecting an asset from the Create Asset window (note that with this method you can create multiple assets of the same type at a time, by setting the value at the bottom):
    +
  • Assets - On the right of the screen you can find The Asset Browser. Here is where you can create and edit the different assets that your game uses, as well as generate and change configurations, game options, room order and other things. Assets are created by right-clicking  on an asset folder (or anywhere in the main Asset Browser view) and selecting Create, or by clicking the plus icon at the top and selecting an asset from the Create Asset window (note that with this method you can create multiple assets of the same type at a time, by setting the value at the bottom):

    - Resources MenuSelecting any one of these options will create a new, empty resource of the given type for you, with the name field highlighted so you can immediately give it a name. Note that while the Asset Browser is docked to the IDE by default, you can take it out and into its own window by clicking Icon LMB on the "Asset Browser" text at the top and dragging. You can re-dock it again at any time by dragging it to the sides or bottom of the IDE. If you close the Asset Browser window and wish to recover it you can use The Windows Menu. For more information on the available assets please see the section on The Asset Editors. + Resources MenuSelecting any one of these options will create a new, empty resource of the given type for you, with the name field highlighted so you can immediately give it a name. Note that while the Asset Browser is docked to the IDE by default, you can take it out and into its own window by clicking  on the "Asset Browser" text at the top and dragging. You can re-dock it again at any time by dragging it to the sides or bottom of the IDE. If you close the Asset Browser window and wish to recover it you can use The Windows Menu. For more information on the available assets please see the section on The Asset Editors.
  • Inspector: On the left of the screen you can find The Inspector. This shows the properties of the element(s) that you have selected in the IDE.
    You can change these properties here as well.
  • @@ -36,17 +37,17 @@

    Workspaces

     

     

    Workspace RMB Menu

    -

    While within any workspace you can call up the Right Button Menu at any time by right-clicking Icon RMB anywhere, which will open the following menu:

    +

    While within any workspace you can call up the Right Button Menu at any time by right-clicking  anywhere, which will open the following menu:

    RMB Menu Options

    Clicking Assets will open up a list of all the assets in The Asset Browser that you can create, and selecting any one of them will create that asset resource for you, as well as focus the workspace on the editor window for that resource. If you click the Windows option, you will be shown a list of all the currently open windows within the workspace and you can select any of them to have the workspace focus on that window. Finally you have the Go To option which will open the following window:

    Goto Window

    -

    This window permits you to search though every asset, function, Game Option and Preference in your project for the search term you input. For example, typing "icon" as the search term will show all the items in your project that have "icon" somewhere in their name, e.g.: if a sprite is spr_Icon_Play, then it will show up here, as will the object " obj_Iconoclast", and you'll even see the Game Options for the different icons like "Icon for hdpi". Clicking on any of the items shown in the filtered list will open it in the current workspace, or focus the workspace on it if it is already open.

    -

    Note that you can also use the keyboard shortcut CTRL Key Icon / CMD Key Icon + T to open the Go To window, and that the number of items listed is (by default) set to a maximum of 16. You can change this maximum limit along with other search options in the Go To section of the General Preferences.

    -

    For more information on Workspace Navigation, please see the section on IDE Input and Navigation.

    +

    This window permits you to search through every asset, function, Game Option and Preference in your project for the search term you input. For example, typing "icon" as the search term will show all the items in your project that have "icon" somewhere in their name, e.g.: if a sprite is spr_Icon_Play, then it will show up here, as will the object " obj_Iconoclast", and you'll even see the Game Options for the different icons like "Icon for hdpi". Clicking on any of the items shown in the filtered list will open it in the current workspace, or focus the workspace on it if it is already open.

    +

    Note that you can also use the keyboard shortcut Ctrl + T / Command + T to open the Go To window, and that the number of items listed is (by default) set to a maximum of 16. You can change this maximum limit along with other search options in the Go To section of the General Preferences.

    +

    For more information on Workspace Navigation, please see the section on IDE Input And Navigation.

     

     

    Docking

    -

    We mentioned briefly above that you can dock many windows into the current workspace window and you can un-dock those that are already docked. If you click Icon LMB on, for example, the Asset Browser tab at the top and drag it to the left of the current workspace, you will see that it becomes a free floating window.

    +

    We mentioned briefly above that you can dock many windows into the current workspace window and you can un-dock those that are already docked. If you click  on, for example, the Asset Browser tab at the top and drag it to the left of the current workspace, you will see that it becomes a free-floating window.

    Un-docking the asset browserThis converse is true and if you drag certain windows to the sides of the workspace (or the bottom) then they will be docked, meaning that it essentially becomes part of the IDE window overlay and is no longer independent. When doing this, you drag the window to the area you want to dock to and it will be highlighted to show that you can dock the window there:

    Docking The Asset BrowserIn this way you can create a personalised IDE experience that fits your workflow and way of doing things. It's worth noting that all docked windows can be hidden/unhidden individually by clicking the button to the side of the docked items (highlighted in the image at the top of this page), or you can hide/unhide all docked items using the quick-button  Docking Icon at the top of the IDE, and note too that the IDE will remember docked windows between sessions.

     Some windows will disappear from the dock when you change editors, like in the Room Editor. However when you return to the editor in question, they will be re-opened in the dock again.

    @@ -103,11 +104,11 @@

    Quick Buttons

    Help Icon - Click this to open the manual (or alternatively, press  Icon F1). + Click this to open the manual (or alternatively, press F1). Zoom Out Icon - This will zoom the focused workspace out to make everything smaller (you can also achieve this holding down CTRL Icon /  CMD Icon and using the mouse wheel MMB Icon). + This will zoom the focused workspace out to make everything smaller (you can also achieve this holding down Ctrl / Command and using the mouse wheel ). Zoom Reset Icon @@ -115,7 +116,7 @@

    Quick Buttons

    Zoom In Icon - This will zoom the focused workspace in to make everything larger (you can also achieve this holding down CTRL Icon /  CMD Icon and using the mouse wheel MMB Icon). + This will zoom the focused workspace in to make everything larger (you can also achieve this holding down Ctrl / Command and using the mouse wheel ). Open Close Docks Icon diff --git a/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/General/Workspace.htm b/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/General/Workspace.htm index da80d94c4..5972cb705 100644 --- a/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/General/Workspace.htm +++ b/Manual/contents/Setting_Up_And_Version_Information/IDE_Preferences/General/Workspace.htm @@ -4,7 +4,7 @@ Workspace - + @@ -18,18 +18,12 @@

    Workspace Preferences

    Workspace Prefs

    The preferences here will affect how you move around within the different GameMaker workspaces. The options are:

      -
    • Workspace keyboard navigation degree range: Within a workspace you can have multiple windows open for different objects and resources, and so to move around quickly between them you can use the keyboard shortcut CONTROL Icon / CMD Icon + ALT Icon + <Arrow Keys> to move between them. Given that the windows within a workspace are not grid aligned the IDE has to choose which window you mean when you press any of the possible 8 directions, and - this option permits you to set the "look angle" that is used. The default value is 40°.
    • -
    • Workspace chain column padding (px): Workspace elements are often "chained" to each other (for example, the Code Editor is chained to the Event Editor is chained to the Object Editor), and this option permits you to set - the horizontal distance between any two chained windows. The default value is 30px.
    • +
    • Workspace keyboard navigation degree range: Within a workspace you can have multiple windows open for different objects and resources, and so to move around quickly between them you can use the keyboard shortcut Ctrl / Command + Alt + <Arrow Keys> to move between them. Given that the windows within a workspace are not grid aligned the IDE has to choose which window you mean when you press any of the possible 4 directions, and this option permits you to set the "look angle" that is used. The default value is 40°.
    • +
    • Workspace chain column padding (px): Workspace elements are often "chained" to each other (for example, the Code Editor is chained to the Event Editor is chained to the Object Editor), and this option permits you to set the horizontal distance between any two chained windows. The default value is 30px.
    • Workspace chain row padding (px): As mentioned above, workspace elements are often "chained" to each other and this option permits you to set the vertical distance between any two chained windows. The default value is 20px.
    • Workspace chain rendering segment count: Here you can set the maximum number of segments for render chains. Lowering this value may help performance on lower end machines. The default value is 20.
    • Workspace chain link colour: This is the colour that will be used to display chains between workspace elements. Default colour is ARGB $99DD00.
    • -
    • Workspace keyboard navigation resets zoom: As mentioned above, you can skip from window to window within the workspace using keyboard shortcuts. You can also zoom the workspace in and out using the CONTROL Icon / CMD Icon + the mouse wheel MMB Icon. Setting this option will mean that if you have the workspace zoomed and use the shortcuts to skip to another window, then the workspace will be returned to a 1:1 view and centered on the selected window. This option is off by default.
    • +
    • Workspace keyboard navigation resets zoom: As mentioned above, you can skip from window to window within the workspace using keyboard shortcuts. You can also zoom the workspace in and out using the Ctrl / Command + the mouse wheel . Setting this option will mean that if you have the workspace zoomed and use the shortcuts to skip to another window, then the workspace will be returned to a 1:1 view and centered on the selected window. This option is off by default.
    • Workspace chains can overlap: When enabled this option will permit workspace chains to cross and overlap. This is off by default.

     

    @@ -42,7 +36,7 @@

    Workspace Preferences

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

    draw_sprite

    -

    This function draws the given sprite and sub-image at a position within the game room. For the sprite you can use the instance variable sprite_index to get the current sprite that is assigned to the instance running the code, or you can use any other sprite asset. The same goes for the sub-image, as this can also be set to the instance variable image_index which will set the sub-image to that selected for the current instance sprite (note, that you can draw a different sprite and still use the sub-image value for the current instance), or you can use any other value for this to draw a specific sub-image of the chosen sprite. If the value is larger than the number of sub-images, then GameMaker will automatically loop the number to select the corresponding image (for example, if the sprite being drawn has 5 sub-images numbered 0 to 4 and we set the index value to 7, then the function will draw sub-image 3, numbered 0). Finally, the x and y position is the position within the room that the sprite will be drawn, and it is centered on the sprite x offset and y offset.

    +

    This function draws the given sprite and sub-image at a position within the game room. For the sprite you can use the instance variable sprite_index to get the current sprite that is assigned to the instance running the code, or you can use any other sprite asset. The same goes for the sub-image, as this can also be set to the instance variable image_index which will set the sub-image to that selected for the current instance sprite (note, that you can draw a different sprite and still use the sub-image value for the current instance), or you can use any other value for this to draw a specific sub-image of the chosen sprite. If the value is larger than the number of sub-images, then GameMaker will automatically loop the number to select the corresponding image (for example, if the sprite being drawn has 5 sub-images numbered 0 to 4 and we set the index value to 7, then the function will draw the third sub-image, numbered 2). Finally, the x and y position is the position within the room that the sprite will be drawn, and it is centered on the sprite x offset and y offset.

    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.

     

    Syntax:

    @@ -30,22 +30,22 @@

    Syntax:

    sprite - Sprite Asset + Sprite Asset The index of the sprite to draw. subimg - Real + Real The sub-image (frame) of the sprite to draw (image_index or -1 correlate to the current frame of animation in the object). x - Real + Real The x coordinate of where to draw the sprite. y - Real + Real The y coordinate of where to draw the sprite. @@ -68,7 +68,7 @@

    Example:

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

    ds_queue_head

    -

    This function will only read the first value of the queue (that which is "at the head"). It will not dequeue the value, meaning that it can still be read in the future by this function or the ds_queue_dequeue(). If the queue is empty then the function will return the constant undefined, otherwise it will return the real or string value contained in the queue.

    +

    This function will only read the first value of the queue (that which is "at the head"). It will not dequeue the value, meaning that it can still be read in the future by this function or ds_queue_dequeue(). If the queue is empty then the function will return the constant undefined, otherwise it will return the value contained in the queue.

     

    Syntax:

    ds_queue_head(id);

    - + + - + - + + - +
    ArgumentTypeArgumentType Description
    ididDS Queue The id of the data structure to read from.

     

    Returns:

    -

    (Data type value stored in the queue)

    +

    Any (Data type value stored in the queue)

     

    Example:

    num = ds_queue_head(control_queue);

    -

    The above code will read the value from the queue indexed in the variable "control_queue" and store the return value in the variable "num".

    +

    The above code will read the head value from the queue indexed in the variable "control_queue" and store the return value in the variable "num".

     

     

     

    @@ -49,7 +51,7 @@

    Example:

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

    ds_queue_tail

    -

    This function will only read the last value of the queue (that which is "at the tail"). It will not dequeue the value, meaning that it can still be read in the future by this function or the ds_queue_dequeue().

    +

    This function will only read the last value of the queue (that which is "at the tail"). It will not remove the value from the structure, meaning that it can be read again by calling this function. If the queue is empty then the function will return the constant undefined, otherwise it will return the value contained in the queue.

     

    Syntax:

    ds_queue_tail(id);

    - + + - + - + + - +
    ArgumentTypeArgumentType Description
    ididDS Queue The id of the data structure to read from.

     

    Returns:

    -

    (Data type value stored in the queue)

    +

    Any (Data type value stored in the queue)

     

    Example:

    num = ds_queue_tail(control_queue);

    -

    The above code will read the value from the queue indexed in the variable "control_queue" and store the return value in the variable "num".

    +

    The above code will read the tail value from the queue indexed in the variable "control_queue" and store the return value in the variable "num".

     

     

     

    @@ -49,7 +51,7 @@

    Example:

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

    bbox_bottom

    This read only variable returns the y position (within the room) of the bottom of the bounding box for the instance, where the bounding box is defined by the maximum width and height of the mask for the instance (as set by the sprite_index or by the mask_index). Even when a sprite has a precise collision mask, the bounding box exists and is used for certain things, and so you can use this variable to find it. Please note that when the instance has no sprite assigned the value returned will be the same as the instance Y position.

    +

    See: Bounding Boxes

     

    Syntax:

    bbox_bottom;

     

    Returns:

    -

    (integer)

    +

    Real (integer)

     

    Example:

    -

    if (bbox_bottom > room_height)
    +

    if (bbox_bottom > room_height)
    {
        y = room_height - sprite_yoffset;
    }

    @@ -39,7 +40,7 @@

    Example:

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

    bbox_left

    This read only variable returns the position (along the x-axis) within the room of the left hand bounding box for the instance, where the bounding box is defined by the maximum width and height of the mask for the instance (as set by the sprite_index or by the mask_index). Even when a sprite has a precise collision mask, the bounding box exists and is used for certain things, and so you can use this variable to find it. Please note that when the instance has no sprite assigned the value returned will be the same as the instance X position.

    +

    See: Bounding Boxes

     

    Syntax:

    bbox_left;

     

    Returns:

    -

    (integer)

    +

    Real (integer)

     

    Example:

    -

    if (bbox_left < 0)
    +

    if (bbox_left < 0)
    {
        x = sprite_xoffset;
    }

    @@ -39,7 +40,7 @@

    Example:

    Next: bbox_top
    -
    © Copyright YoYo Games Ltd. 2021 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved

    bbox_right

    This read only variable returns the position within the room (along the x-axis) of the right hand side of the bounding box for the instance, where the bounding box is defined by the maximum width and height of the mask for the instance (as set by the sprite_index or by the mask_index). Even when a sprite has a precise collision mask, the bounding box exists and is used for certain things, and so you can use this variable to find it. Please note that when the instance has no sprite assigned the value returned will be the same as the instance X position.

    +

    See: Bounding Boxes

     

    Syntax:

    bbox_right;

     

    Returns:

    -

    (integer)

    +

    Real (integer)

     

    Example:

    -

    if (bbox_right > room_width)
    +

    if (bbox_right > room_width)
    {
        x = room_width - sprite_xoffset;
    }

    @@ -39,7 +40,7 @@

    Example:

    Next: bbox_left
    -
    © Copyright YoYo Games Ltd. 2021 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved

    bbox_top

    This read only variable returns the position within the room (along the y-axis) of the top of the bounding box for the instance, where the bounding box is defined by the maximum width and height of the mask for the instance (as set by the sprite_index or by the mask_index). Even when a sprite has a precise collision mask, the bounding box exists and is used for certain things, and so you can use this variable to find it. Please note that when the instance has no sprite assigned the value returned will be the same as the instance Y position.

    +

    See: Bounding Boxes

     

    Syntax:

    bbox_top;

     

    Returns:

    -

    (integer)

    +

    Real (integer)

     

    Example:

    -

    if (bbox_top < 0)
    +

    if (bbox_top < 0)
    {
        y = sprite_yoffset;
    }

    @@ -39,7 +40,7 @@

    Example:

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

    sprite_prefetch

    +

    sprite_prefetch

    This function can be used to prefetch (place into texture memory) a texture page with the given sprite. You supply the sprite index as defined when you created the sprite asset, and the texture page it is on will be loaded into memory. Note that the function will return -1 if prefetch is not supported for the chosen resource or the target platform is HTML5, or it will return 0 if all worked correctly.

     

     

    Syntax:

    -

    sprite_prefetch(ind)

    +

    sprite_prefetch(ind)

    @@ -30,21 +30,20 @@

    Syntax:

    - +
    indSprite AssetSprite Asset The sprite index to fetch

     

    Returns:

    -

    Real (-1 or 0)

    +

    Real (-1 or 0)

     

    Example:

    -

    sprite_prefetch(spr_Player_Aura);

    +

    sprite_prefetch(spr_Player_Aura);

    The above code will place the referenced sprite into texture memory ready for use.

     

     

    -

     

    -

    sprite_prefetch_multi

    +

    sprite_prefetch_multi

    This function can be used to prefetch (place into texture memory) a number of texture pages that contain the sprites given. You supply an array populated with the sprite indices (as defined when you created the sprite asset) and the texture pages that they are on will be loaded into memory. Note that the function will return -1 if prefetch is not supported for the chosen resource or the target platform is HTML5, or it will return 0 if all worked correctly.

     

    @@ -29,14 +29,14 @@

    Syntax:

    array - Array of Sprite Assets + Array of Sprite Assets Array with the sprite indices to fetch

     

    Returns:

    -

    Real (-1 or 0)

    +

    Real (-1 or 0)

     

    Example:

    spr_a[0] = spr_Player_Aura1;
    @@ -55,7 +55,7 @@

    Example:

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

    Drawing

    -

    This section contains all the functions related to drawing within the game room, as well as for controlling how things will be drawn (blending, alpha, culling, etc...). There are a great number of different functions for drawing, and they are split over the following categories to make it easier to find what you need:

    +

    Drawing

    +

    This section contains all the functions related to drawing within the game room, as well as for controlling how things will be drawn (blending, alpha, culling, etc.). There are a great number of different functions for drawing, and they are split over the following categories to make it easier to find what you need:

    • Colour And Alpha
    • GPU Control
    • @@ -43,11 +43,11 @@

      Drawing

      Textures

      -

      The following functions are all related to "textures", i.e.: images that are stored in VRAM to be used as sprites or other things within your game.

      +

      The following functions are all related to "textures", i.e.: images that are stored in VRAM to be used as sprites or other graphical elements within your game.

      Textures refer to: 

      • Texture Pages created by GameMaker, which contain:  @@ -27,6 +27,32 @@

        Textures

      • Surfaces: custom textures that provide a canvas that you can draw anything to
      +

      Texture Compression

      +

      Texture compression is image compression applied to textures specifically.

      +

      A game's textures can take up a large part of memory, in RAM as well as in VRAM. For example, a texture image of 2048 x 2048 pixels that contains all four channels (R, G, B and A) takes up (2048 x 2048) pixels x 4 channels/pixel x 1 bytes/channel = 16777216 bytes, or 16MB of video memory. All this data needs to be loaded into RAM and then be sent to VRAM.

      +

      Textures can be compressed to reduce their size, which minimises the amount of data that needs to be moved from RAM memory to VRAM when textures are prefetched (as the available "bandwidth" is limited). Additionally, if your game does many texture lookups and the platform it's running on does not have sufficient graphics memory bandwidth to handle the texture reading at a high frame rate, the game may slow down.

      +

      GameMaker has two ways to allow for texture compression and decompression. Texture compression is set per texture group and works differently according to the format used: 

      +
        +
      • BZ + QOIQOI, PNG - The asset compiler compresses all textures in the texture group to the given format and stores them with the game. When they are loaded from disk into RAM, they remain compressed while in RAM. When a texture from this texture group format is then fetched into VRAM, it is decompressed on the CPU and this decompressed data stored in VRAM.
      • +
      • Custom - GPU texture compression. The textures are generated at compile time using an external tool that compresses the textures to a format optimised for decompressing on the GPU and are then stored with the game. When a texture of this format is loaded into RAM, it remains compressed there. When it's fetched into VRAM, the texture data still remains compressed there. The texture is decompressed by the GPU in real time when it performs texel lookups on the texture.
      • +
      +

      The following image shows a comparison of different texture formats: 

      +
      +
      A comparison of different texture group formats.
      + From left to right: BZ2 + QOI (no GPU texture compression), BC7 and BC3.
      +
      +

      GPU Compressed Textures

      +

      The textures are stored compressed in VRAM and are decompressed in real time by the GPU.

      +

      Custom GPU texture compression is done using an extension: GM-GPUTextureCompression. To generate GPU textures, you should first add this extension to your project.

      +

      After adding the extension, to enable GPU compressed textures for a texture group: 

      +
        +
      • Set the Texture Group Format to Custom.
      • +
      • Enter the tool to use, along with the settings under Custom Options. For example, to generate medium quality BC7 compressed textures, set this to BCN -u2.
      • +
      +

      When the game is compiled, the textures are generated by the external tool, which is executed through the extension. The tool compresses the textures to a format optimised for decompressing on the GPU.

      +

      For full information on the available texture formats that are supported, see the wiki.

      +

       Certain texture formats are only supported on certain platforms. You should make sure to select an appropriate one for the platform that you're compiling to. An error message is shown in The Output Window if the extension isn't present or any of the settings is incorrect.

      +

      GPU compressed textures are compressed using block compression. This is the most common form of GPU compression and is supported in some format on almost all modern platforms. When the GPU texture is generated from the original image using e.g. BCN compression, it is subdivided into fixed-size blocks of 4x4 pixels or texels (other compression algorithms support different block sizes). The information in the pixels in this block is converted to a 128 bit value. When the GPU reads back this value, it restores the colour value of the requested pixel from it as precisely as possible. See S3_Texture_Compression for more information.

      Function Reference

      Texture Page Info

      The following functions are used to retrieve information about specific images and their position or size on the Texture Page, as well as set certain texture features:

      @@ -40,7 +66,7 @@

      Texture Page Info

    • texture_global_scale

    VRAM Management

    -

    The following functions are related to the managing the VRAM associated with individual textures as well as whole texture groups:

    +

    The following functions are related to managing the VRAM associated with individual textures as well as whole texture groups:

    • draw_texture_flush
    • texture_prefetch
    • @@ -80,7 +106,7 @@

      Next: Video Playback -

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

      draw_flush

      - -

      With this function you can flush the entire draw pipeline. This is a debug only function and in general it should not be used unless indicated by a member of the YoYo Games Support - staff, as indiscriminate use will cause serious performance issues with your game.

      - +

      draw_flush

      +

      This function flushes the entire draw pipeline.

      +

      This is a debug-only function and in general it should not be used unless indicated by a member of the YoYo Games Support staff, as indiscriminate use will cause serious performance issues with your game.

       

      Syntax:

      -

      draw_flush();

      +

      draw_flush();

       

       

      Returns:

      -

      +

      N/A

       

      Example:

      -

      draw_flush();

      - -

      The above code flushes the draw pipeline.

      - -

       

      +

      draw_flush();

      +

      The above code flushes the draw pipeline.

       

       

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

      Texture Pages

      +

      Texture Pages

      When you create a game with GameMaker, you will surely have created graphics - Sprites, Tile Sets and Fonts - to go along with it. These graphics are stored on Texture Pages which GameMaker builds for you from all the image assets that your game contains. Below is an example of a complete texture page:

      Texture Page ExampleAs you can see, the game graphics are all jumbled up together in such a way that they all fit on a power of 2 sized page, e.g. 512x512, 1024x512, etc., up to a maximum size of 4096x4096 pixels per page. Note that the maximum size of a texture page will depend on the chosen export platform, as some targets will not permit pages larger than 2048x2048px, and even then, the maximum available size may not be optimal for all the devices that use the target platform OS.

      Note too that if your images have a lot of empty space (i.e.: transparent pixels) around them, then they will be cropped by default to remove any of these "invisible" pixels and pack as many images as possible onto a single texture page. If this is not what you wish to happen, then you need to disable it from the Texture Groups window.

      @@ -22,7 +22,7 @@

      Texture Pages

      Texture Page OptionsHere you can define how the image is to be stored on the texture page, as well as whether it has to be stored separately. You can also set which texture page it has to be assigned to as well as a few other options (explained in depth on the Sprite Editor page).

      Tile Horizontally & Tile Vertically

      These relate to how the edges of the image will be created when placed on the texture page.

      -

      An image that is to be tiled will have the edges (horizontal or vertical) added to by the edges from the opposite side, while if no tiling is selected the sprite will be clamped and the edges pixels will be repeated (note that tilesets also have a setting for the output border width, found in the Tile Set Properties which does the same thing, only for each tile in the set). The following image illustrates this:

      +

      An image that is to be tiled will have the edges (horizontal or vertical) added to by the edges from the opposite side, while if no tiling is selected the sprite will be clamped and the edge's pixels will be repeated (note that tilesets also have a setting for the output border width, found in the Tile Set Properties which does the same thing, only for each tile in the set). The following image illustrates this:

      Texture Page Results

      Separate Texture Page

      Underneath those settings is the Separate Texture Page setting. This option will force GameMaker to place this image on its own unique texture page and there are no options associated with this as the tiling or clamping is controlled directly through code. This is most commonly used for texturing 3D models (in which case the texture should be a power of 2, eg: 128x128, 512x512, 256x1024, etc.), but you can use it to force any image to be drawn to its own unique page.

      @@ -41,7 +41,7 @@

      Separate Texture Page

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

      draw_flush

      This function flushes the entire draw pipeline.

      -

      This is a debug-only function and in general it should not be used unless indicated by a member of the YoYo Games Support staff, as indiscriminate use will cause serious performance issues with your game.

      +

      This is a debug-only function and in general it should not be used unless indicated by a member of the GameMaker Support staff, as indiscriminate use will cause serious performance issues with your game.

       

      Syntax:

      draw_flush();

      From 356f7dcb321dd821291824d9ce26345ae6d2c678 Mon Sep 17 00:00:00 2001 From: YYBartT Date: Tue, 30 Apr 2024 12:25:19 +0200 Subject: [PATCH 21/21] docs(feature): GPU texture compression YoYoGames/GameMaker-Bugs#5495 * Moved texture compression to its own page, under Texture Groups * Added "Texture Compression" as a new section on the Texture Groups page * Added to TOC --- .../Drawing/Textures/Textures.htm | 26 --------- Manual/contents/Settings/Texture_Groups.htm | 5 +- .../Texture_Compression.htm | 54 +++++++++++++++++++ .../Texture_Information/Texture_Pages.htm | 4 +- Manual/toc/Default.toc | 1 + 5 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 Manual/contents/Settings/Texture_Information/Texture_Compression.htm diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/Textures.htm b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/Textures.htm index 0449036a9..21a2c2f47 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/Textures.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Drawing/Textures/Textures.htm @@ -27,32 +27,6 @@

      Textures

    • Surfaces: custom textures that provide a canvas that you can draw anything to
    -

    Texture Compression

    -

    Texture compression is image compression applied to textures specifically.

    -

    A game's textures can take up a large part of memory, in RAM as well as in VRAM. For example, a texture image of 2048 x 2048 pixels that contains all four channels (R, G, B and A) takes up (2048 x 2048) pixels x 4 channels/pixel x 1 bytes/channel = 16777216 bytes, or 16MB of video memory. All this data needs to be loaded into RAM and then sent to VRAM.

    -

    Textures can be compressed to reduce their size, which minimises the amount of data that needs to be moved from RAM memory to VRAM when textures are prefetched (as the available "bandwidth" is limited). Additionally, if your game does many texture lookups and the platform it's running on does not have sufficient graphics memory bandwidth to handle the texture reading at a high frame rate, the game may slow down.

    -

    GameMaker has two ways to allow for texture compression and decompression. Texture compression is set per texture group and works differently according to the format used: 

    -
      -
    • BZ + QOIQOI, PNG - The asset compiler compresses all textures in the texture group to the given format and stores them with the game. When they are loaded from disk into RAM, they remain compressed while in RAM. When a texture from this texture group format is then fetched into VRAM, it is decompressed on the CPU and this decompressed data stored in VRAM.
    • -
    • Custom - GPU texture compression. The textures are generated at compile time using an external tool that compresses the textures to a format optimised for decompressing on the GPU and are then stored with the game. When a texture of this format is loaded into RAM, it remains compressed there. When it's fetched into VRAM, the texture data still remains compressed. The texture is decompressed by the GPU in real time when it performs texel lookups on the texture.
    • -
    -

    The following image shows a comparison of different texture formats: 

    -
    -
    A comparison of different texture group formats.
    - From left to right: BZ2 + QOI (no GPU texture compression), BC7 and BC3.
    -
    -

    GPU Compressed Textures

    -

    The textures are stored in a compressed format in VRAM and are decompressed in real time by the GPU.

    -

    Custom GPU texture compression is done using an extension: GM-GPUTextureCompression. To generate GPU textures, you should first add this extension to your project.

    -

    After adding the extension, to enable GPU compressed textures for a texture group: 

    -
      -
    • Set the Texture Group Format to Custom.
    • -
    • Enter the tool to use, along with the settings under Custom Options. For example, to generate medium quality BC7 compressed textures, set this to BCN -u2.
    • -
    -

    When the game is compiled, the textures are generated by the external tool, which is executed through the extension. The tool compresses the textures to a format optimised for decompressing on the GPU.

    -

    For full information on the available texture formats that are supported, see the wiki.

    -

     Certain texture formats are only supported on certain platforms. You should make sure to select an appropriate one for the platform that you're compiling to. An error message is shown in The Output Window if the extension isn't present or any of the settings is incorrect.

    -

    GPU compressed textures are compressed using block compression. This is the most common form of GPU compression and is supported in some format on almost all modern platforms. When the GPU texture is generated from the original image using e.g. BCN compression, it is subdivided into fixed-size blocks of 4x4 pixels or texels (other compression algorithms support different block sizes). The information in the pixels in this block is converted to a 128 bit value. When the GPU reads back this value, it restores the colour value of the requested pixel from it as precisely as possible. See S3_Texture_Compression for more information.

    Function Reference

    Texture Page Info

    The following functions are used to retrieve information about specific images and their position or size on the Texture Page, as well as set certain texture features:

    diff --git a/Manual/contents/Settings/Texture_Groups.htm b/Manual/contents/Settings/Texture_Groups.htm index feae29f39..c759ac17c 100644 --- a/Manual/contents/Settings/Texture_Groups.htm +++ b/Manual/contents/Settings/Texture_Groups.htm @@ -37,6 +37,9 @@

    Texture Group vs. Texture Page

    A single texture group can have multiple texture pages -- they are not equivalent.

    If your game has a lot of unique graphics for each level, then you may define a single texture group for each of the levels, but the group's graphics may require two or more texture pages. This depends on whether the selected texture page size (in the Game Options for your target) is able to fit all the graphics within a texture group.

    See: Texture Pages

    +

    Texture Compression

    +

    The textures in a texture group are compressed using the format set under Texture Group Format. They can be decompressed before being sent to VRAM or in real time by the GPU.

    +

    See: Texture Compression

    Dynamic Textures

    You can set up Dynamic Texture Groups, which can be loaded and unloaded at runtime to save memory.

    See: Dynamic Textures

    @@ -53,7 +56,7 @@

    Group Settings


    The BZ2 + QOI, QOI and PNG formats compress all texture images to the given format. You can choose QOI if the BZ2 option affects speed on a target platform (e.g. Android), or PNG if you wish for the exported PNGs to be modified or use the "PNGCrush" pragma. For basic use it is recommended to stick with the default option, BZ2 + QOI, as it offers the best compression while retaining quality.

    - Setting this to Custom allows you to use specific texture formats that are optimised for decompression in real time on the GPU. The tool and settings to generate the textures have to be set under Custom Options. See Texture Compression for detailed info. + Setting this to Custom allows you to use specific texture formats that are optimised for decompression in real time on the GPU. The tool and settings to generate the textures have to be set under Custom Options. See  for detailed info.

     Child texture groups are stored in the same texture group format as their parent, since the assets they contain are added to a texture page of the parent group.

  • Texture Group Type - Here you can set whether this is a regular Texture Group or a Dynamic Texture Group.
  • diff --git a/Manual/contents/Settings/Texture_Information/Texture_Compression.htm b/Manual/contents/Settings/Texture_Information/Texture_Compression.htm new file mode 100644 index 000000000..1a3e4b80f --- /dev/null +++ b/Manual/contents/Settings/Texture_Information/Texture_Compression.htm @@ -0,0 +1,54 @@ + + + + + + + Texture Compression + + + + + + + + +

    Texture Compression

    +

    Texture compression is image compression applied to textures specifically.

    +

    A game's textures can take up a large part of memory, in RAM as well as in VRAM. For example, a texture image of 2048 x 2048 pixels that contains all four channels (R, G, B and A) takes up (2048 x 2048) pixels x 4 channels/pixel x 1 bytes/channel = 16777216 bytes, or 16MB of video memory. All this data needs to be loaded into RAM and then sent to VRAM.

    +

    Textures can be compressed to reduce their size, which minimises the amount of data that needs to be moved from RAM memory to VRAM when textures are prefetched (as the available "bandwidth" is limited). Additionally, if your game does many texture lookups and the platform it's running on does not have sufficient graphics memory bandwidth to handle the texture reading at a high frame rate, the game may slow down.

    +

    GameMaker has two ways to allow for texture compression and decompression. Texture compression is set per texture group and works differently according to the format used: 

    +
      +
    • BZ + QOIQOI, PNG - The asset compiler compresses all textures in the texture group to the given format and stores them with the game. When they are loaded from disk into RAM, they remain compressed while in RAM. When a texture from this texture group format is then fetched into VRAM, it is decompressed on the CPU and this decompressed data stored in VRAM.
    • +
    • Custom - GPU texture compression. The textures are generated at compile time using an external tool that compresses the textures to a format optimised for decompressing on the GPU and are then stored with the game. When a texture of this format is loaded into RAM, it remains compressed there. When it's fetched into VRAM, the texture data still remains compressed. The texture is decompressed by the GPU in real time when it performs texel lookups on the texture.
    • +
    +

    The following image shows a comparison of different texture formats: 

    +
    +
    A comparison of different texture group formats.
    + From left to right: BZ2 + QOI (no GPU texture compression), BC7 and BC3.
    +
    +

    GPU Compressed Textures

    +

    The textures are stored in a compressed format in VRAM and are decompressed in real time by the GPU.

    +

    Custom GPU texture compression is done using an extension: GM-GPUTextureCompression. To generate GPU textures, you should first add this extension to your project.

    +

    After adding the extension, to enable GPU compressed textures for a texture group: 

    +
      +
    • Set the Texture Group Format to Custom.
    • +
    • Enter the tool to use, along with the settings under Custom Options. For example, to generate medium quality BC7 compressed textures, set this to BCN -u2.
    • +
    +

    When the game is compiled, the textures are generated by the external tool, which is executed through the extension. The tool compresses the textures to a format optimised for decompressing on the GPU.

    +

    For full information on the available texture formats that are supported, see the wiki.

    +

     Certain texture formats are only supported on certain platforms. You should make sure to select an appropriate one for the platform that you're compiling to. An error message is shown in The Output Window if the extension isn't present or any of the settings is incorrect.

    +

    GPU compressed textures are compressed using block compression. This is the most common form of GPU compression and is supported in some format on almost all modern platforms. When the GPU texture is generated from the original image using e.g. BCN compression, it is subdivided into fixed-size blocks of 4x4 pixels or texels (other compression algorithms support different block sizes). The information in the pixels in this block is converted to a 128 bit value. When the GPU reads back this value, it restores the colour value of the requested pixel from it as precisely as possible. See S3_Texture_Compression for more information.

    +

     

    +

     

    + + + \ No newline at end of file diff --git a/Manual/contents/Settings/Texture_Information/Texture_Pages.htm b/Manual/contents/Settings/Texture_Information/Texture_Pages.htm index f1b04fd55..2bdb5ee91 100644 --- a/Manual/contents/Settings/Texture_Information/Texture_Pages.htm +++ b/Manual/contents/Settings/Texture_Information/Texture_Pages.htm @@ -37,8 +37,8 @@

    Separate Texture Page