pub struct TextureAtlasFile {
pub padding: u32,
pub bleeding: u32,
pub usages: RenderAssetUsages,
pub entries: Vec<TextureAtlasEntry>,
}Expand description
Asset file representation of TextureAtlas.
This struct impls Serialize and
Deserialize, which means it may be (de)serialized into any implementation, albeit
TextureAtlasLoader uses RON format specifically.
Fields§
§padding: u32How far away the edges of one sprite to another and to the page boundaries, in pixels. This may be utilized to mitigate the imperfect precision with texture sampling where a fraction of neighboring sprites actually get sampled instead.
bleeding: u32How much the sprites will “bleed” outside its edge. That is, how much times the edges of a sprite is copied to its surrounding border, creating a bleeding effect. This may be utilized to mitigate the imperfect precision with texture sampling where the edge of a sprite doesn’t quite reach the edge of the vertices.
usages: RenderAssetUsagesDefines the usages for the resulting atlas pages.
entries: Vec<TextureAtlasEntry>File entries relative to the atlas configuration file.
Implementations§
Source§impl TextureAtlasFile
impl TextureAtlasFile
Sourcepub const fn default_padding() -> u32
pub const fn default_padding() -> u32
Default padding of a texture atlas is 4 pixels.
Sourcepub const fn default_bleeding() -> u32
pub const fn default_bleeding() -> u32
Default bleeding of a texture atlas is 4 pixels.
Sourcepub const fn default_usages() -> RenderAssetUsages
pub const fn default_usages() -> RenderAssetUsages
Default usage of texture atlas pages is RenderAssetUsages::RENDER_WORLD.
Sourcepub fn serialize_usages<S: Serializer>(
usages: &RenderAssetUsages,
ser: S,
) -> Result<S::Ok, S::Error>
pub fn serialize_usages<S: Serializer>( usages: &RenderAssetUsages, ser: S, ) -> Result<S::Ok, S::Error>
Serializes the usages into (main: <bool>, render: <bool>).
Sourcepub fn deserialize_usages<'de, D: Deserializer<'de>>(
de: D,
) -> Result<RenderAssetUsages, D::Error>
pub fn deserialize_usages<'de, D: Deserializer<'de>>( de: D, ) -> Result<RenderAssetUsages, D::Error>
Deserializes the usages from (main: <bool>, render: <bool>).
Trait Implementations§
Source§impl Clone for TextureAtlasFile
impl Clone for TextureAtlasFile
Source§fn clone(&self) -> TextureAtlasFile
fn clone(&self) -> TextureAtlasFile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextureAtlasFile
impl Debug for TextureAtlasFile
Source§impl<'de> Deserialize<'de> for TextureAtlasFile
impl<'de> Deserialize<'de> for TextureAtlasFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TextureAtlasFile
impl RefUnwindSafe for TextureAtlasFile
impl Send for TextureAtlasFile
impl Sync for TextureAtlasFile
impl Unpin for TextureAtlasFile
impl UnwindSafe for TextureAtlasFile
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more