The demos use textures, fonts, sounds, shaders and a 3D model that are
not part of the installed package, to keep it small. The first time a
resource is needed it is downloaded from the raylibr GitHub repository
into a cache directory (see tools::R_user_dir()), and later calls use
the cached copy.
Details
Resources are looked up in this order:
The package's
demo_resourcesdirectory, which the webR build includes.The directory in the
RAYLIBR_ASSETSenvironment variable, if set, e.g. theassetsdirectory of a raylibr checkout.The cache, downloading the resource first if needed.
Examples
if (FALSE) { # interactive()
texture_file <- raylibr_resource("space.png")
shader_dir <- raylibr_resource("model")
list.files(shader_dir)
}
