pub struct TextureAtlas { /* private fields */ }
Expand description
Contains font data in an atlas, where each character occupied a small rectangle.
More characters can be added, possibly expanding the texture.
Implementations§
source§impl TextureAtlas
impl TextureAtlas
pub fn new(size: [usize; 2]) -> Self
pub fn size(&self) -> [usize; 2]
sourcepub fn prepared_discs(&self) -> Vec<PreparedDisc>
pub fn prepared_discs(&self) -> Vec<PreparedDisc>
Returns the locations and sizes of pre-rasterized discs (filled circles) in this atlas.
sourcepub fn fill_ratio(&self) -> f32
pub fn fill_ratio(&self) -> f32
When this get high, it might be time to clear and start over!
sourcepub fn texture_options() -> TextureOptions
pub fn texture_options() -> TextureOptions
The texture options suitable for a font texture
sourcepub fn take_delta(&mut self) -> Option<ImageDelta>
pub fn take_delta(&mut self) -> Option<ImageDelta>
Call to get the change to the image since last call.
Trait Implementations§
source§impl Clone for TextureAtlas
impl Clone for TextureAtlas
source§fn clone(&self) -> TextureAtlas
fn clone(&self) -> TextureAtlas
Returns a copy of the value. Read more
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for TextureAtlas
impl RefUnwindSafe for TextureAtlas
impl Send for TextureAtlas
impl Sync for TextureAtlas
impl Unpin for TextureAtlas
impl UnwindSafe for TextureAtlas
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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