load

function

load(_path[, _sha1[, _onLoad]])

Description

Asynchronnously loads a resource from a file or retrieves a reference to it, if it is already loaded.

Arguments

Name Type Description
_path String The path to the resource.
_sha1 String Expected SHA1 of the file. If the actual one does not match with this, then the resource will not be loaded. Use undefined if you do not want to check the SHA1 of the file.
_onLoad Function A function to execute when the resource is loaded or if an error occurs while loading it. It must take the error as the first argument and the resource as the second argument. If no error occurs, then undefined is passed. If the resource was already loaded when calling this function, then this callback is not executed.

Returns

Struct.BBMOD_Resource The resource or undefined.

Note

Currently supported files formats are *.bbmod for BBMOD_Model, *.bbanim for BBMOD_Animation, *.bbmat for BBMOD_Material and *.png, *.gif, *.jpg/jpeg for BBMOD_Sprite.

Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on November 16, 2022 using GMDoc.