Skip to content

Commit

Permalink
Parent Texture Group does not affect children
Browse files Browse the repository at this point in the history
YoYoGames/GameMaker-Bugs#2079
* Changed the description of the Parent Texture Group setting to explain children groups go on the same texture page
* Mentioned under Texture Group Format that child groups therefore use the same format (since they share the texture page)
* Fixed a couple of small typos
  • Loading branch information
YYBartT committed Jan 4, 2024
1 parent 66db717 commit ea44d48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
23 changes: 13 additions & 10 deletions Manual/contents/Settings/Texture_Groups.htm
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1>Texture Groups</h1>
<h1><span data-field="title" data-format="default">Texture Groups</span></h1>
<p><img alt="Texture Group Editor" class="center" src="../assets/Images/Settings/Texture_Groups.png" />The <strong>Texture Group Manager</strong> is available from <a data-xref="{title}" href="../IDE_Navigation/Menus/The_Tools_Menu.htm">The Tools Menu</a> in the IDE. Here you can add, delete and rename <strong>Texture Groups</strong>.</p>
<p><span data-keyref="GameMaker Name">GameMaker</span> permits you to assign each of the graphics assets in your project (Sprites, Tile Sets, and Fonts) to different texture groups, to optimise the number of texture swaps that the hardware does at any given time in your game.</p>
<p>For that to work, you need to define the necessary texture groups from this window, and then go through the asset list and assign groups to them.</p>
<h2>How Textures Work</h2>
<p>Before we dive into creating and editing Texture Groups, let&#39;s understand how Texture Groups are loaded.</p>
<p>Before we dive into creating and editing Texture Groups, let&#39;s understand how they&#39;re loaded.</p>
<div data-conref="../assets/snippets/How_Textures_Work.hts"> </div>
<h2>Adding a Texture Group</h2>
<p>By default all images in your game will be added to the &quot;Default&quot; texture group, which always exists. You can click on the <strong>Add New</strong> button to create a new texture group, and if you select the name of the group you can change it to something appropriate.</p>
<p>To start with the group will show &quot;<em>This group is empty</em>&quot; for each section of the group (Sprites, Tile Sets and Fonts). Add an asset using the <strong>Add Asset</strong> button at the bottom, or by selecting multiple assets in the list and right-clicking to move those assets into a different group:</p>
<p>To start with, the group will show &quot;<em>This group is empty</em>&quot; for each section of the group (Sprites, Tile Sets and Fonts). Add an asset using the <strong>Add Asset</strong> button at the bottom, or by selecting multiple assets in the list and right-clicking to move those assets into a different group:</p>
<p><img class="center" src="../assets/Images/Settings/Texture_Groups_MoveTo.png" />Alternatively you can add assets to a texture group via the right mouse button <img alt="RMB Icon" class="icon" height="24" src="../assets/Images/Icons/Icon_RMB.png" width="21" /> menu in <a data-xref="{title}" href="../Introduction/The_Asset_Browser.htm">The Asset Browser</a>. You can select one or more Sprite/Tile Set/Font assets and then use the RMB menu to add the assets to any group, as shown below for Tile Sets:</p>
<p><img alt="Asset Browser RMB Menu For Tilesets" class="center" src="../assets/Images/Settings/QS_RMBMenu_Tilesets.png" /></p>
<p>Texture groups other than the &quot;Default&quot; one can also be deleted at any time, which will move their contents into the &quot;Default&quot; group (if you delete a group by mistake you can use <img alt="Control Icon" class="icon" height="20" src="../assets/Images/Icons/Icon_Ctrl.png" width="55" /> / <img alt="CMD Icon" class="icon" height="20" src="../assets/Images/Icons/Icon_Cmd.png" width="55" /> + &quot;<span class="inline">Z</span>&quot; to undo the action).</p>
<p>Texture groups other than the &quot;Default&quot; one can also be deleted at any time, which will move their contents into the &quot;Default&quot; group.</p>
<p class="note"><span data-conref="../assets/snippets/Tag_note.hts"> </span> If you delete a group by mistake you can use <img alt="Control Icon" class="icon" height="20" src="../assets/Images/Icons/Icon_Ctrl.png" width="55" /> / <img alt="CMD Icon" class="icon" height="20" src="../assets/Images/Icons/Icon_Cmd.png" width="55" /> + &quot;<span class="inline">Z</span>&quot; to undo the action.</p>
<h2>Editing a Texture Group</h2>
<p>Once you have added assets into a Texture Group, you will see them listed on the left of the main Texture Group editor window, and clicking on any of the sprites in this list will show them in the image preview window on the right. This is particularly helpful when working on large projects and you need to be able to see which images have been assigned to which group.</p>
<p>If the images assigned to the group have multiple sub-images (i.e. they are animated), then only the first sub-image is shown in the preview window. You can also right click <img alt="RMB Icon" class="icon" height="24" src="../assets/Images/Icons/Icon_RMB.png" width="21" /> on an asset to open a small menu giving you the option to move it to another texture group or open the editor for that asset.</p>
<p>Even though the assets are shown in the list as being separate, all Sprites, Tile Sets and Fonts will be added to the same texture page (or pages), and cannot get an individual page for each asset type. The only exception to this rule is when a sprite asset has been flagged as being for a &quot;<strong>Separate Texture Page</strong>&quot;, in which case it will be given its own individual texture page (see the section on &quot;Texture Settings&quot; in <a data-xref="{title}" href="../The_Asset_Editors/Sprites.htm">The Sprite Editor</a> for more details).</p>
<p>Even though the assets are shown in the list as being separate, all sprites, tile sets and fonts will be added to the same texture page, as long as there is room on that texture page. If the texture page is full, <span data-keyref="GameMaker Name">GameMaker</span> adds the remaining assets to another texture page (or pages). So by default you cannot get an individual page for each asset type. The only exception to this rule is when you flag a sprite asset as being for a &quot;<strong>Separate Texture Page</strong>&quot;, in which case it will be given its own individual texture page (see the section on &quot;Texture Settings&quot; in <a data-xref="{title}" href="../The_Asset_Editors/Sprites.htm">The Sprite Editor</a> for more details).</p>
<h2>Texture Group vs. Texture Page</h2>
<p>A single <strong>texture group</strong> can have multiple <strong>texture pages</strong> -- they are not equivalent.</p>
<p>If your game has a lot of unique graphics for each level, then you may define a single texture <em>group </em>for each of the levels, but the group&#39;s graphics may require two or more texture <em>pages</em>. This depends on whether the selected texture page size (in the <a href="Game_Options.htm">Game Options</a> for your target) is able to fit all the graphics within a texture group.</p>
Expand All @@ -45,17 +46,19 @@ <h2>Group Settings</h2>
<ul class="colour">
<li><strong>Allow Scaling</strong> - Unflagging this will force <span data-keyref="GameMaker Name">GameMaker</span> to not scale the texture group under any circumstances. This can be useful, especially when dealing with universal apps, as it allows you to put specific resources like fonts in a group of its own to be used when the app is run on a specific device. For example, fonts can look great on a retina display, but when they are scaled down to draw on a normal display they can look terrible so you can assign them to a special non-scaling group - if developing for the iPhone, you may wish to have this checked, as apps have been rejected due to the images being blurred by texture scaling. This is flagged as <em>on </em>by default.</li>
<li><strong>Automatically Crop</strong> - When you add images into <span data-keyref="GameMaker Name">GameMaker</span>, if they have any &quot;space&quot; around them (i.e. 100% transparency) this is automatically cropped when it is added into the texture page and &quot;Automatically Crop&quot; is flagged. However, if, for example, you are using the image as a non-repeating texture for primitives or anything similar, this means that the UV coordinates for texture mapping are not going to be correctly represented. In these cases you can un-flag this option and the sprite will be added to the texture page &quot;as is&quot;, maintaining any transparencies that it may have around the edges. This is flagged as <em>on </em>by default.</li>
<li><strong>Generate Mipmaps</strong> - Flagging this option (it is off by default) will tell <span data-keyref="GameMaker Name">GameMaker</span> that the original texture page is to be scaled and filtered into multiple resolutions within the texture file. This is normally <em>off</em>, but if you are using cameras to zoom in or out on large areas of the game room, or you are working with a 3D game, then you may want to enable this and then use the <a href="../GameMaker_Language/GML_Reference/Drawing/Mipmapping/Mipmapping.htm">Mipmapping Functions</a> to adjust how the game deals with the different mipmap levels. When you flag this check box the &quot;Border Size&quot; value will be set to 8 (if it was set to less than 8 originally). This is because, when using mipmaps, you need larger borders between images on the texture pages otherwise they start bleeding together at higher mip levels. The default value of 8 will allow the image to be reduced to about an eighth of its original size before the sub-images start bleeding together, but you can change this to any value that is required to suit your needs. Note that if you are using the &quot;<strong>Separate Texture Page</strong>&quot; option for sprites, then you do not need to go through each texture here and flag it to generate mipmaps, but instead you can go to the <a href="Game_Options.htm">General Game Options</a> and flag the option &quot;<strong>Generate mipmaps for separate texture pages</strong>&quot;.</li>
<li><strong>Generate Mipmaps</strong> - Flagging this option (it is off by default) will tell <span data-keyref="GameMaker Name">GameMaker</span> that the original texture page is to be scaled and filtered into multiple resolutions within the texture file. This is normally <em>off</em>, but if you are using cameras to zoom in or out on large areas of the game room, or you are working with a 3D game, then you may want to enable this and then use the <a href="../GameMaker_Language/GML_Reference/Drawing/Mipmapping/Mipmapping.htm">Mipmapping Functions</a> to adjust how the game deals with the different mipmap levels. When you flag this checkbox the &quot;Border Size&quot; value will be set to 8 (if it was set to less than 8 originally). This is because, when using mipmaps, you need larger borders between images on the texture pages otherwise they start bleeding together at higher mip levels. The default value of 8 will allow the image to be reduced to about an eighth of its original size before the sub-images start bleeding together, but you can change this to any value that is required to suit your needs. Note that if you are using the &quot;<strong>Separate Texture Page</strong>&quot; option for sprites, then you do not need to go through each texture here and flag it to generate mipmaps, but instead you can go to the <a href="Game_Options.htm">General Game Options</a> and flag the option &quot;<strong>Generate mipmaps for separate texture pages</strong>&quot;.</li>
<li><strong>Border Size</strong> - The border size will change the overlap (or &quot;pixel doubling&quot;) amount around the edges of all assets on the pages generated for the texture group so that when the images are scaled, there are no gaps (or seams) visible between them. The default is 2 pixels, but in extreme cases where you are zooming the view in or out a great deal then you may need to increase this value. Note that the <a href="../The_Asset_Editors/Tile_Sets.htm">Tile Set Editor</a> has an option to set the output border for tiles (and also provides an explanation of why this is necessary), and this is separate to the border setting here - basically, tiles are generated with an output border for each tile on a temporary texture, and this is then added to the texture page with the border given here around the outside edge. Also note that enabling Mipmaps will automatically set the default border size for the texture page to 8 to help prevent &quot;bleeding&quot; between textures at higher mip levels, but this can be changed.</li>
<li><strong>Parent Texture Group</strong> - Here you can choose any of the existing groups to be the &quot;parent&quot; group for the currently selected one. &quot;Child&quot; groups will inherit the platform settings assigned to the parent texture group, which is useful for resource management when working with cross-platform games. A texture group with a parent is still a texture group in its own right and will generate texture pages the same as any other group, but assigning them a parent allows you to exclude large chunks for different platforms. For example, you can add a whole load of Android player sprites to a &quot;player&quot; group, and Android enemy sprites to an &quot;enemy&quot; group, then make them both use an &quot;android&quot; parent group. If you then exclude the &quot;android&quot; parent group from the Windows or other platform build, the child groups will be excluded too.</li>
<li><strong>Texture Group Format</strong> - Here you can choose the format for your texture page, between <strong>BZ2 + QOI</strong>, <strong>QOI</strong> and <strong>PNG</strong>. It is recommended to stick with the default option, <strong>BZ2 + QOI</strong>, as it offers the best compression while retaining quality.<br />
<li><strong>Parent Texture Group</strong> - Here you can choose any of the existing groups to be the &quot;parent&quot; group for the currently selected one. Sprites, fonts and tilesets assigned to &quot;child&quot; groups are placed on a texture page of the parent texture group, if the parent group is included on a target platform. When the parent texture group isn&#39;t included on a platform, the child texture group&#39;s items are placed on a separate texture page.</li>
<li><strong>Texture Group Format</strong> - Here you can choose the format for the texture page(s) in this texture group, between <strong>BZ2 + QOI</strong>, <strong>QOI</strong> and <strong>PNG</strong>. It is recommended to stick with the default option, <strong>BZ2 + QOI</strong>, as it offers the best compression while retaining quality.<br />
<br />
You can choose <strong>QOI</strong> if the BZ2 option affects speed on a target platform (e.g. Android), or <strong>PNG</strong> if you wish for the exported PNGs to be modified or use the <a href="../GameMaker_Language/GML_Reference/OS_And_Compiler/gml_pragma.htm">PNGCrush option</a>.
You can choose <strong>QOI</strong> if the BZ2 option affects speed on a target platform (e.g. Android), or <strong>PNG</strong> if you wish for the exported PNGs to be modified or use the <a href="../GameMaker_Language/GML_Reference/OS_And_Compiler/gml_pragma.htm">PNGCrush option</a>.<br />
<br />
Note that 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.
</li>
<li><strong>Texture Group Type</strong> - Here you can set whether this is a regular Texture Group or a <a href="Texture_Information/Dynamic_Textures.htm">Dynamic Texture Group</a>.</li>
<li><strong>Dynamic Group Path</strong> - Here you can set the path within the final game package where the texture group will be stored. This only works if the group is Dynamic. If this is empty, exported textures are placed at the root of the game package.</li>
</ul>
<p><img class="center" src="../assets/Images/Settings/Texture_Groups_Exports.png" />Other than those settings you can also choose to export (or not) any given texture group to any given platform by simply checking or un-checking the appropriate boxes from the <strong>Use Group On...</strong> section of the window. Note though that the <span class="inline">&lt;Default&gt;</span> texture group is <em>always exported to every platform</em>, and you can&#39;t check/un-check any of them (only custom texture groups permit this).</p>
<p><img class="center" src="../assets/Images/Settings/Texture_Groups_Exports.png" />Other than those settings you can also choose to export (or not) any given texture group to any given platform by simply checking or unchecking the appropriate boxes from the <strong>Use Group On...</strong> section of the window. Note though that the <span class="inline">&lt;Default&gt;</span> texture group is <em>always exported to every platform</em>, and you can&#39;t check/uncheck any of them (only custom texture groups permit this).</p>
<p>Texture Groups are also linked to the <a href="Configurations.htm">Configurations</a> settings. What this means is that you can define texture groups for each individual configuration of your game, and then set the sprite, tile set or font resource assignments to these different groups and it will be &quot;remembered&quot; when you change to a different configuration. The same will happen to any export options that you have chosen in the Texture Group window, so you can set the texture groups to export to specific platforms on a per-configuration basis.</p>
<p>One use for this is, for example, that you could make an iPad configuration and for that create 2048x2048px texture pages (setting this up via the <a href="Game_Options.htm">Game Options</a>). You would then assign all the graphics assets to the appropriate texture group, and when finished, you would then change to a different configuration (for HTML5, for example) and from the Texture Group window, create new texture groups that are 512x512px, assigning the assets to these new groups. There is also a button at the bottom of the page that permits you to copy texture group settings from one configuration to another.</p>
<p> </p>
Expand Down
Loading

0 comments on commit ea44d48

Please sign in to comment.