[−][src]Struct wasm_game_lib::graphics::text::Text
A text drawable on a Canvas.
Fields
coords: (usize, usize)
The coords of the text in px.
font: &'a Font
The font of the text.
text: String
The text.
style: TextStyle<'a>
The style of the text (bold/italic...)
character_size: (usize, &'a str)
The character_size. example: (14, "px")
Methods
impl<'a> Text<'a>
[src]
pub fn new(font: &'a Font) -> Text<'a>
[src]
Create a new text with default values.
pub fn new_with_text_and_coords(
font: &'a Font,
text: String,
coords: (usize, usize)
) -> Text<'a>
[src]
font: &'a Font,
text: String,
coords: (usize, usize)
) -> Text<'a>
Create a new text with some default values.
pub fn new_with_options(
font: &'a Font,
text: String,
coords: (usize, usize),
style: TextStyle<'a>,
character_size: (usize, &'a str)
) -> Text<'a>
[src]
font: &'a Font,
text: String,
coords: (usize, usize),
style: TextStyle<'a>,
character_size: (usize, &'a str)
) -> Text<'a>
Create a new text with no default value.
pub fn set_text(&mut self, text: String)
[src]
Set the displayed text.
pub fn set_style(&mut self, style: TextStyle<'a>)
[src]
Set the style of the text.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Text<'a>
impl<'a> Send for Text<'a>
impl<'a> Sync for Text<'a>
impl<'a> Unpin for Text<'a>
impl<'a> UnwindSafe for Text<'a>
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>,