1
2
3
4
5
6
7
8
9
10
11
12
use lotus_script_sys::FfiObject;
pub use lotus_shared::content::*;

/// Preload an asset like a texture you want to swap later or font you want to use.
/// The asset will be loaded and kept in memory until the script gets unloaded.
pub fn preload(id: ContentId) {
    let id = FfiObject::new(&id);

    unsafe {
        lotus_script_sys::assets::preload(id.packed());
    }
}