User Tools

Site Tools


en:tutorials:resources:resource_reloading

Resource Reloading

You are able to support swapping sets of assets at runtime effortlessly. This could be used for swapping between low/high resolution assets, or switching themes. Let's work through an example of switching between high and low resolution assets.

Setting up a new project

To help you work through this tutorial, first create a new blank project using the init script.

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/highres folder in your project.

Setting up resources

Edit the config file and replace the Resource section with:

[Resource]
Texture = @ResourceLowRes
Sound   = @ResourceLowRes
 
[ResourceHighRes]
Texture = ../data/texture/highres
Sound   = ../data/sound/highres
 
[ResourceLowRes]
Texture = ../data/texture/lowres
Sound   = ../data/sound/lowres

This sets the texture and sound resources as a default to the lowres paths. Notice that sound is also defined, but we won't be covering sound in the tutorial.

en/tutorials/resources/resource_reloading.txt · Last modified: 2025/09/30 17:26 (9 months ago) by 127.0.0.1