A function defined in __bbmod_async.gml

bbmod_sprite_add_async(_file, _callback)


Asynchronnously loads a sprite from a file.


Name Type Description
_file String The path to the file to load the sprite from.
_callback Function The function to execute when the sprite is loaded or if an error occurs. It must take the error as the first argument and the sprite as the second argument. If no error occurs, then undefined is passed. If an error does occur, then sprite is undefined.


bbmod_sprite_add_async("sprite.png", function (_error, _sprite) {
   if (_error != undefined)
       // Handle error here...
   // Use the loaded sprite here...


You must call bbmod_async_image_loaded_update in an appropriate event for this function to work!

Do you find this page helpful?

Copyright © 2024, BlueBurn. Built on April 16, 2024 using GMDoc.