pub struct TextureAtlas { /* private fields */ }Available on crate feature
egui only.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], options: TextOptions) -> TextureAtlas
pub fn options(&self) -> &TextOptions
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 image(&self) -> &ColorImage
pub fn image(&self) -> &ColorImage
The full font atlas image.
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 duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Forget for TextureAtlas
impl Freeze for TextureAtlaswhere
*const u8 is !null: Freeze,
PhantomData<Color32>: Freeze,
PhantomData<PrerasterizedDisc>: Freeze,
impl Move for TextureAtlas
impl RefUnwindSafe for TextureAtlas
impl Send for TextureAtlaswhere
RawVecInner: Send,
impl Sync for TextureAtlaswhere
RawVecInner: Sync,
impl Unpin for TextureAtlas
impl UnsafeUnpin for TextureAtlaswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Color32>: UnsafeUnpin,
PhantomData<PrerasterizedDisc>: UnsafeUnpin,
impl UnwindSafe for TextureAtlaswhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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