Skip to main content

get_texture_or_create_from_file

Function get_texture_or_create_from_file 

Source
pub fn get_texture_or_create_from_file(
    identifier: impl AsRef<str>,
    file: impl AsRef<Path>,
) -> Option<Texture>
Expand description

Attempts to retrieve a texture or creates it from the given file path.

A conversion of the file path may have to be performed every call. To avoid the conversion when the path is known to be ASCII, use get_texture_or_create_from_file_ascii.