[−][src]Struct ggez::graphics::TextFragment
A piece of text with optional color, font and font scale information.
Drawing text generally involves one or more of these.
These options take precedence over any similar field/argument.
Implements From
for char
, &str
, String
and
(String, Font, Scale)
.
Fields
text: String
Text string itself.
color: Option<Color>
Fragment's color, defaults to text's color.
font: Option<Font>
Fragment's font, defaults to text's font.
scale: Option<Scale>
Fragment's scale, defaults to text's scale.
Methods
impl TextFragment
[src]
pub fn new<T: Into<Self>>(text: T) -> Self
[src]
Creates a new fragment from String
or &str
.
pub fn color(self, color: Color) -> TextFragment
[src]
Set fragment's color, overrides text's color.
pub fn font(self, font: Font) -> TextFragment
[src]
Set fragment's font, overrides text's font.
pub fn scale(self, scale: Scale) -> TextFragment
[src]
Set fragment's scale, overrides text's scale.
Trait Implementations
impl<'a> From<&'a str> for TextFragment
[src]
fn from(text: &'a str) -> TextFragment
[src]
impl From<char> for TextFragment
[src]
fn from(ch: char) -> TextFragment
[src]
impl From<String> for TextFragment
[src]
fn from(text: String) -> TextFragment
[src]
impl<T> From<(T, Font, f32)> for TextFragment where
T: Into<TextFragment>,
[src]
T: Into<TextFragment>,
impl Clone for TextFragment
[src]
fn clone(&self) -> TextFragment
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for TextFragment
[src]
impl Debug for TextFragment
[src]
Auto Trait Implementations
impl Unpin for TextFragment
impl Sync for TextFragment
impl Send for TextFragment
impl RefUnwindSafe for TextFragment
impl UnwindSafe for TextFragment
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> Erased for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.