Skip to main content

load

Function load 

Source
pub fn load(path: &Path, id: impl Into<String>) -> Result<Sprite, CoreError>
Expand description

Load a single image file and return a Sprite with normalized RGBA8 pixel data.

Supports PNG, JPEG, BMP, TGA, WebP, and TIFF natively via the image crate. With the svg feature enabled, SVG files are rasterized at their natural viewport size. With the psd feature enabled, PSDs are flattened to a single RGBA layer.

The returned Sprite has trim_rect, polygon, nine_patch, pivot, and alias_of all set to None. Those fields are filled by later pipeline stages.