User Tools

Site Tools


en:tutorials:resources:resource_reloading

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:tutorials:resources:resource_reloading [2021/08/28 07:06 (3 years ago)] – [Swapping to high-res using Code] sausageen:tutorials:resources:resource_reloading [2021/08/28 12:07 (3 years ago)] (current) – [Swapping to high-res using Code] iarwain
Line 7: Line 7:
 ===== The assets ====== ===== The assets ======
  
-Download these two sprite textures and save them to a data\texture\lowres folder in your project.+Download these two sprite textures and save them to a ''data/texture/lowres'' folder in your project.
  
-{{ :tutorials:resources:buggy.png?nolink |}} {{ :tutorials:resources:oil.png?nolink |}}+{{ :tutorials:resources:lowres:buggy.png?nolink |}} {{ :tutorials:resources:lowres:oil.png?nolink |}}
  
-Download these two sprite textures and save them to a data\texture\highres folder in your project.+Download these two sprite textures and save them to a ''data/texture/highres'' folder in your project.
  
-{{ :tutorials:resources:buggy-highres.png?nolink |}} {{ :tutorials:resources:oil-hires.png?nolink |}} +{{ :tutorials:resources:highres:buggy.png?nolink |}} {{ :tutorials:resources:highres:oil.png?nolink |}}
- +
-Remove the ''-hires'' from the filenames before saving.+
  
 ===== Setting up resources ===== ===== Setting up resources =====
Line 80: Line 78:
 ===== Swapping to high-res using Commands ===== ===== Swapping to high-res using Commands =====
  
-While the app is running, press the '~' key (tilde) to open the Orx Console.+While the app is running, press the ''~'' key (tilde) to open the Orx Console.
  
 Enter the following commands to switch to the high resolution assets: Enter the following commands to switch to the high resolution assets:
Line 110: Line 108:
  
 <code c> <code c>
-orxResource_RemoveStorage("Texture", orxNULL); +orxResource_RemoveStorage("Texture", orxNULL);  // Removes all the storages from the Texture group
  
 orxConfig_PushSection("Resource"); orxConfig_PushSection("Resource");
-orxConfig_SetString("Texture", "@ResourceHighRes"); // Switch to the high-res textures+orxConfig_SetString("Texture", "@ResourceHighRes"); // Switches to the high-res textures
 orxConfig_PopSection(); orxConfig_PopSection();
  
Line 125: Line 123:
   - For this to all work, the resources themselves should have the same names, just located at different places (for example: ''data/texture/high'' versus ''data/texture/low'').   - For this to all work, the resources themselves should have the same names, just located at different places (for example: ''data/texture/high'' versus ''data/texture/low'').
   - ''orxResource_Sync(const orxSTRING _zGroup);'' can be restricted to particular object groups if you wish.   - ''orxResource_Sync(const orxSTRING _zGroup);'' can be restricted to particular object groups if you wish.
 +  - ''orxResource_RemoveStorage(const orxSTRING _zGroup, const orxSTRING _zStorage)'' can optionally be restricted to both a particular resource group and a particular resource storage.
en/tutorials/resources/resource_reloading.txt · Last modified: 2021/08/28 12:07 (3 years ago) by iarwain