Struct gfx_voxel::texture::AtlasBuilder
[−]
[src]
pub struct AtlasBuilder { /* fields omitted */ }
Builds an atlas of textures.
Methods
impl AtlasBuilder
[src]
fn new<P>(path: P, unit_width: u32, unit_height: u32) -> Self where P: Into<PathBuf>
Creates a new AtlasBuilder
.
fn load(&mut self, name: &str) -> (u32, u32)
Loads a file into the texture atlas. Checks if the file is loaded and returns position within the atlas. The name should be specified without file extension. PNG is the only supported format.
fn min_alpha(&mut self, rect: [u32; 4]) -> u8
Finds the minimum alpha value in a given sub texture of the image.
fn complete<R, F>(self, factory: &mut F) -> Texture<R> where R: Resources, F: Factory<R>
Returns the complete texture atlas as a texture.