pub struct Prefs {
pub unit_size: u32,
pub padding: u32,
pub uv_inset: f32,
pub trim_transparent: bool,
pub atlas_size_limit: u32,
pub atlas_square: bool,
pub atlas_pot: bool,
pub ppu: f32,
pub pivot: Pivot,
pub on_progress: Option<ProgressCallback>,
}
Expand description
Preferences for a dicing operation.
Fields§
§unit_size: u32
The size of a single diced unit, in pixels. Larger values result in less generated mesh overhead, but may also diminish number of reused texture regions.
padding: u32
The size of border, in pixels, to add between adjacent diced units inside atlas textures. Increase to prevent texture bleeding artifacts. Larger values consume more texture space, but yield better anti-bleeding results.
uv_inset: f32
Relative inset (in 0.0-1.0 range) of the diced units UV coordinates. Can be used in addition to (or instead of) [padding] to prevent texture bleeding artifacts. Won’t consume texture space, but higher values could visually distort the rendered sprite.
trim_transparent: bool
Whether to trim transparent areas on the built meshes. Disable to preserve aspect ratio of the source sprites (usable for animations).
atlas_size_limit: u32
Maximum size (width or height) of a single generated atlas texture; will generate multiple textures when the limit is reached.
atlas_square: bool
The generated atlas textures will always be square. Less efficient, but required for PVRTC compression.
atlas_pot: bool
The generated atlas textures will always have width and height be power of two. Extremely inefficient, but required by some older GPUs.
ppu: f32
Pixel per unit ratio to use when evaluating positions of the generated mesh vertices. Higher values will make sprite smaller in conventional space units.
pivot: Pivot
Origin of the generated mesh, in relative offsets from top-left corner of the sprite rect.
on_progress: Option<ProgressCallback>
Callback to invoke when dicing operation progress changes in a meaningful way.