pub struct Text { /* fields omitted */ }
A piece of text that can be rendered.
Creates a new Text
, with the given content, font and scale.
pub fn set_content<S>(&mut self, content: S) where S: Into<String>, | [src] |
Sets the content of the text.
Get the outer bounds of the text when rendered to the screen.
If the text is not rendered yet, this method will re-render it and calculate the bounds.
The bounds are automatically cached, so calling this multiple times will only render once.
Note that this method will not take into account the positioning applied to the text via DrawParams
.
Sets the font of the text.
Sets the size of the text.
Draws self
to the currently enabled render target, using the specified parameters. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<SS, SP> SupersetOf for SP where SS: SubsetOf<SP>, | |
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.
impl<T> SetParameter for T | |
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where T: Parameter<Self>, | |
Sets value
as a parameter of self
.