pub enum SampleMode {
Pixel,
Smooth,
}Expand description
Re-exported because SheetDesc::sample is spelled in it: a crate whose
public API names a foreign type and does not export it is one every caller
has to add a dependency for.
NineSlice and Rect are here for the same reason —
NineSliceSource’s fields are spelled in both.
How a sprite is sampled when the screen does not agree with the art.
Variants§
Pixel
Preserve the art’s pixels as exactly as the output allows.
Not simply nearest-neighbour. At a non-integer scale — a 320-wide field stretched across a 1366-wide canvas — nearest makes some art pixels four screen pixels across and their neighbours five, and the unevenness crawls as the sprite moves. This mode samples linearly but bends the UV so the blend happens only within a one-fragment band at each texel boundary, which is identical to nearest at whole scales and even-looking at every other one.
Smooth
Ordinary filtered sampling, for art that is not pixel art and for the normal 2D and 3D path.
Trait Implementations§
Source§impl Clone for SampleMode
impl Clone for SampleMode
Source§fn clone(&self) -> SampleMode
fn clone(&self) -> SampleMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more