[][src]Struct vulkano_glyph::GlyphBrush

pub struct GlyphBrush<'font> { /* fields omitted */ }

Object responsible for drawing text to the screen.

Methods

impl<'font> GlyphBrush<'font>[src]

pub fn new(
    device: &Arc<Device>,
    subpass: Subpass<Arc<dyn RenderPassAbstract + Send + Sync>>
) -> Result<Self>
[src]

Create a new GlyphBrush for use in the given subpass.

pub fn queue_glyphs<I>(
    &mut self,
    glyphs: I,
    font: FontId,
    color: [f32; 4]
) -> Section where
    I: IntoIterator<Item = PositionedGlyph<'font>>, 
[src]

Queue some glyphs for later drawing. The Section returned is valid until a later call to GlyphBrush::clear.

pub fn cache_sections<'a, I>(
    &mut self,
    queue: &Arc<Queue>,
    sections: I
) -> Result<Option<CommandBufferExecFuture<NowFuture, AutoCommandBuffer>>> where
    I: IntoIterator<Item = &'a Section>, 
[src]

Cache some sections of text. If a future is returned, it should be executed before drawing those sections. This may overwrite cached sections from previous calls to this function.

pub fn draw<'a, I>(
    &mut self,
    cmd: AutoCommandBufferBuilder,
    sections: I,
    state: &DynamicState,
    transform: [[f32; 4]; 4],
    dims: [f32; 2]
) -> Result<AutoCommandBufferBuilder> where
    I: IntoIterator<Item = &'a Section>, 
[src]

Draw a section of text to the screen. The section should have been previously cached using GlyphBrush::cache_sections.

pub fn clear(&mut self)[src]

Clear the internal glyph buffer. This invalidates all Section objects created by this GlyphBrush.

Auto Trait Implementations

impl<'font> Send for GlyphBrush<'font>

impl<'font> Sync for GlyphBrush<'font>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Content for T[src]

impl<T> Erased for T