Extends BBMOD_Class


new BBMOD_ResourceManager()


Using this struct you can easily load, retrieve and free from memory any BBMOD resources.


Name Description
Loading Number of resources that are currently loading.


Name Description
add Adds a resource to the resource manager.
async_image_loaded_update Must be executed in the "Async - Image Loaded" event!
async_save_load_update Must be executed in the "Async - Save/Load" event!
free Frees a reference to the resource. When there are no other no other references, the resource is destroyed.
get Retrieves a reference to a resource.
get_or_add Retrieves a reference to a resource. If the resource does not exist yet, then it is added.
has Checks if the resource manager has a resource.
load Asynchronnously loads a resource from a file or retrieves a reference to it, if it is already loaded.


Create a resource manager in OMain:

/// @desc Create event
resourceManager = new BBMOD_ResourceManager();

/// @desc Clean Up event

/// @desc Async - Image Loaded event

/// @desc Async - Save/Load event

Use the resource manager in another object to load its model or just retrieve a reference to it, if it is already loaded.

/// @desc Create event
model = OMain.resourceManager.load("Data/Model.bbmod");

/// @desc Clean Up event
// Free the reference. This is not necessary if you do not want to unload
// the model when all instances are destroyed. It will always be unloaded
// when the resource manager is destroyed.;

/// @desc Draw event
matrix_set(matrix_world, matrix_build(x, y, z, 0, 0, 0, 1, 1, 1));
Do you find this page helpful?

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