mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added docs to assets::load_map
Former-commit-id: 50397d3c5d8c30ea392b784d9309d0e2ecb28f73
This commit is contained in:
parent
8348633a0f
commit
0bb217d53f
@ -36,6 +36,15 @@ lazy_static! {
|
||||
RwLock::new(HashMap::new());
|
||||
}
|
||||
|
||||
/// Function used to load assets. Permits manipulating the loaded asset with a mapping function.
|
||||
/// Loaded assets are cached in a global singleton hashmap.
|
||||
/// Example usage:
|
||||
/// ```no_run
|
||||
/// use image::DynamicImage;
|
||||
/// use veloren_common::assets;
|
||||
///
|
||||
/// let my_image = assets::load::<DynamicImage>("core.ui.backgrounds.city").unwrap();
|
||||
/// ```
|
||||
pub fn load_map<A: Asset + 'static, F: FnOnce(A) -> A>(
|
||||
specifier: &str,
|
||||
f: F,
|
||||
|
Loading…
Reference in New Issue
Block a user