[−][src]Struct pushrod_widgets::caches::TextureCache
This is a storage object for the TextureCache
.
Implementations
impl TextureCache
[src]
The TextureCache
provides a mechanism for caching images, and returning the current
text rendering context.
pub fn get_ttf_context(&self) -> &Sdl2TtfContext
[src]
Returns the currently available text context as a reference.
pub fn get_image(
&mut self,
c: &mut Canvas<Window>,
image_name: String
) -> &Texture
[src]
&mut self,
c: &mut Canvas<Window>,
image_name: String
) -> &Texture
Returns an image loaded into a Texture
reference, caching it in memory.
pub fn render_text(
&mut self,
c: &mut Canvas<Window>,
properties: &mut WidgetProperties,
alt_color: Option<Color>
) -> (Texture, u32, u32)
[src]
&mut self,
c: &mut Canvas<Window>,
properties: &mut WidgetProperties,
alt_color: Option<Color>
) -> (Texture, u32, u32)
Renders text, given the font name, size, style, color, string, and max width. Transfers
ownership of the Texture
to the calling function, returns the width and height of the
texture after rendering. By using the identical font name, size, and style, if SDL2 caches
the font data, this will allow the font to be cached internally.
Trait Implementations
impl Default for TextureCache
[src]
Default implementation for TextureCache.
Auto Trait Implementations
impl RefUnwindSafe for TextureCache
impl !Send for TextureCache
impl !Sync for TextureCache
impl Unpin for TextureCache
impl UnwindSafe for TextureCache
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,