pub struct TextRenderer { /* private fields */ }Implementations§
Source§impl TextRenderer
impl TextRenderer
pub fn new( device: &Device, queue: &Queue, surface_format: TextureFormat, font_bytes: &[u8], bake_size_px: f32, ) -> Result<Self>
Sourcepub fn queue(
&mut self,
text: &str,
position: [f32; 2],
size_px: f32,
color: [f32; 4],
)
pub fn queue( &mut self, text: &str, position: [f32; 2], size_px: f32, color: [f32; 4], )
Queues straight-alpha RGBA text at the first line’s ascender in viewport pixels.
Sourcepub fn record(
&mut self,
device: &Device,
queue: &Queue,
encoder: &mut CommandEncoder,
view: &TextureView,
viewport_size: [f32; 2],
)
pub fn record( &mut self, device: &Device, queue: &Queue, encoder: &mut CommandEncoder, view: &TextureView, viewport_size: [f32; 2], )
Draws and clears the text queue.
pub fn metrics(&self) -> &TextMetrics
pub fn bake_size_px(&self) -> f32
pub fn line_height_px(&self) -> f32
Auto Trait Implementations§
impl Freeze for TextRenderer
impl !RefUnwindSafe for TextRenderer
impl Send for TextRenderer
impl Sync for TextRenderer
impl Unpin for TextRenderer
impl UnsafeUnpin for TextRenderer
impl !UnwindSafe for TextRenderer
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