Skip to main content

Assets Management

Game engine uses custom assets bundling structure, to provide the best performance and flexibility. Check ResourceLoader and IResourceBundle for details.

Structure of assets bundle is the following:

[
{
"name": "simple-image",
"path": "assets/images/simple-image.png"
},
{
"name": "spine-animation",
"path": "assets/spine/spine-animation[.json,.atlas,.png]",
"type": "spine"
},
{
"name": "texture-atlas",
"path": "assets/atlas/[atlas.json,image_1.png,image_2.png]",
"type": "atlas"
}
]

Assets can be bundled with additional options. These options could be applied to the whole bundle, or separately for each resource. Check ResourceLoader and IResourceOptions for details.

[
{
"name": "spine-animation",
"path": "assets/spine/spine-animation[.json,.atlas,.png]",
"type": "spine",
"options": {
"mergeSpineAtlas": true,
"replaceImageFormat": {
"png": [ "avif", "webp", "jp2" ]
}
}
}
]