Struct ggez::graphics::TextFragment [−][src]
pub struct TextFragment { pub text: String, pub color: Option<Color>, pub font_id: Option<FontId>, pub scale: Option<Scale>, }
A piece of text with optional color, font and font scale information.
These options take precedence over any similar field/argument.
Can be implicitly constructed from String
, (String, Color)
, and (String, FontId, Scale)
.
Fields
text: String
Text string itself.
color: Option<Color>
Fragment's color, defaults to text's color.
font_id: Option<FontId>
Fragment's font ID, defaults to text's font ID.
scale: Option<Scale>
Fragment's scale, defaults to text's scale.
Trait Implementations
impl Clone for TextFragment
[src]
impl Clone for TextFragment
fn clone(&self) -> TextFragment
[src]
fn clone(&self) -> TextFragment
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for TextFragment
[src]
impl Debug for TextFragment
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for TextFragment
[src]
impl Default for TextFragment
impl From<String> for TextFragment
[src]
impl From<String> for TextFragment
fn from(text: String) -> TextFragment
[src]
fn from(text: String) -> TextFragment
Performs the conversion.
impl From<(String, Color)> for TextFragment
[src]
impl From<(String, Color)> for TextFragment
impl<FI> From<(String, FI, Scale)> for TextFragment where
FI: Into<FontId>,
[src]
impl<FI> From<(String, FI, Scale)> for TextFragment where
FI: Into<FontId>,
impl<'a> From<&'a str> for TextFragment
[src]
impl<'a> From<&'a str> for TextFragment
fn from(text: &'a str) -> TextFragment
[src]
fn from(text: &'a str) -> TextFragment
Performs the conversion.
impl<'a> From<(&'a str, Color)> for TextFragment
[src]
impl<'a> From<(&'a str, Color)> for TextFragment
impl<'a, FI> From<(&'a str, FI, Scale)> for TextFragment where
FI: Into<FontId>,
[src]
impl<'a, FI> From<(&'a str, FI, Scale)> for TextFragment where
FI: Into<FontId>,
Auto Trait Implementations
impl Send for TextFragment
impl Send for TextFragment
impl Sync for TextFragment
impl Sync for TextFragment