Cerberus X Documentation

Resource paths in Cerberus X

App resources may be stored in many different locations, for example, in an app's data dir, on the local filesystem, or on a remote server.

App data directory

The app's data dir is a sub-directory in the directory where your app's main file is stored and has the name AppName.data - e.g. if your main file is stored as myProject/myApp.cxs your data dir is myProject/myApp.data/ and resources can be loaded from there.

Locating resources

When using functions and methods that open or load resources, you can use any of the following prefixes when specifying resource paths:

Not all prefixes work on all targets and the exact behavior of each prefix is target dependant. For example, android and ios can load images from http:// but not audio, while glfw cannot load from http:// at all. Full support for all prefixes is an ongoing mission!

Also, note that Mojo module load commands will automatically insert a cerberus://data/ prefix before any path that does not already include a prefix. For example, the two following lines are the same:

LoadImage( "myimage.png" )
LoadImage( "cerberus://data/myimage.png" )

Resource path prefix support

mojo.app.LoadStringweb, data, filedata, filedata, filedata, fileweb, datadataNA
mojo.graphics.LoadImageweb, data, fileweb, data, filedata, filedata, fileweb, datadataNA
mojo.audio.LoadSounddatadata, filedata, filedata, fileweb, datadataNA
mojo.audio.PlayMusicdatadata, filedata, filedata, fileweb, datadataNA
DataBuffer.Loadweb, data, filedata, filedata, filedata,fileweb, datadatafile