from_file_async

function

from_file_async(_file[, _sha1[, _callback]])

Description

Asynchronnously loads the resource from a file.

Arguments

Name Type Description
_file String The path to the file.
_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.
_callback Function The function to execute when the resource is loaded or if an error occurs or. It must take the error as the first argument and the resource as the second argument. If no error occurs, then undefined is passed. Defaults to undefined.

Returns

Struct.BBMOD_Resource Returns self.

Note

Do not forget to call bbmod_async_save_load_update and bbmod_async_image_loaded_update in appropriate events when using asynchronnous loading! You can also use BBMOD_ResourceManager for unified asynchronnous loading of resources.

Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on September 19, 2022 using GMDoc.