Struct piston_window::text::Text
source · pub struct Text {
pub color: [f32; 4],
pub font_size: u32,
pub round: bool,
}
Expand description
Renders text
Fields§
§color: [f32; 4]
The color
font_size: u32
The font size
round: bool
Whether or not the text’s position should be rounded (to a signed distance field).
Implementations§
source§impl Text
impl Text
sourcepub fn round(self) -> Text
pub fn round(self) -> Text
A builder method indicating that the Text’s position should be rounded upon drawing.
sourcepub fn draw_pos<C, G>(
&self,
text: &str,
pos: [f64; 2],
cache: &mut C,
draw_state: &DrawState,
transform: [[f64; 3]; 2],
g: &mut G
) -> Result<(), <C as CharacterCache>::Error>where
C: CharacterCache,
G: Graphics<Texture = <C as CharacterCache>::Texture>,
pub fn draw_pos<C, G>( &self, text: &str, pos: [f64; 2], cache: &mut C, draw_state: &DrawState, transform: [[f64; 3]; 2], g: &mut G ) -> Result<(), <C as CharacterCache>::Error>where C: CharacterCache, G: Graphics<Texture = <C as CharacterCache>::Texture>,
Draws text at position with a character cache
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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