pub struct TextRun<'a> {
pub text: &'a str,
pub x: f32,
pub y: f32,
pub size: f32,
pub color: [f32; 4],
}Expand description
A single positioned run of text the frontend queues for the current frame.
Coordinates are top-left device pixels (matching the diagnostics overlay);
color is linear RGBA in 0.0..=1.0. The public seam the overlay and a
later HUD both fill.
Fields§
§text: &'a strThe text to draw (a single line; no wrapping is applied).
x: f32Left edge, device pixels from the surface’s top-left.
y: f32Top edge, device pixels from the surface’s top-left.
size: f32Font size in device pixels.
color: [f32; 4]Linear RGBA in 0.0..=1.0.
Auto Trait Implementations§
impl<'a> Freeze for TextRun<'a>
impl<'a> RefUnwindSafe for TextRun<'a>
impl<'a> Send for TextRun<'a>
impl<'a> Sync for TextRun<'a>
impl<'a> Unpin for TextRun<'a>
impl<'a> UnsafeUnpin for TextRun<'a>
impl<'a> UnwindSafe for TextRun<'a>
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