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...
return;
}
// Use the loaded sprite here...
});
You must call bbmod_async_image_loaded_update in an appropriate event for this function to work!
Copyright © 2025, BlueBurn. Built on January 04, 2025 using GMDoc.