[][src]Struct rs_tiled_json::object::Text

pub struct Text {
    pub text: String,
    pub bold: bool,
    pub italic: bool,
    pub strikeout: bool,
    pub underline: bool,
    pub kerning: bool,
    pub wrap: bool,
    pub pixelsize: u16,
    pub color: Color,
    pub fontfamily: String,
    pub halign: HAlign,
    pub valign: VAlign,
}

Text is an oject that contains all kinds of characteristics of text that Tiled is able to display, including the string itself.

Fields

text: Stringbold: boolitalic: boolstrikeout: boolunderline: boolkerning: boolwrap: boolpixelsize: u16color: Colorfontfamily: Stringhalign: HAlignvalign: VAlign

Methods

impl Text[src]

pub fn text(&self) -> &String[src]

Get the string of text needing displayed.

pub fn is_bold(&self) -> bool[src]

Is the text supposed to be bold?

pub fn is_italic(&self) -> bool[src]

Is the text supposed to be italic?

pub fn is_strikeout(&self) -> bool[src]

Does the text have a striekout?

pub fn is_underline(&self) -> bool[src]

Is the text supposed to be underlined?

pub fn is_kerning(&self) -> bool[src]

Does the text use kerning for display?

pub fn is_wrap(&self) -> bool[src]

Does the text wrap around? If it does, the containing Object structure probably contains more relevant information for wrapping.

pub fn pixel_size(&self) -> u16[src]

Discribe the size in pixels of the text.

pub fn color(&self) -> Color[src]

Retrieve the color the text is supposed to be.

pub fn font_family(&self) -> &String[src]

Get the font-family of the text.

pub fn horizontal_alignment(&self) -> HAlign[src]

Get the horizontal alignment in the form of an HAlign enum. You can call to_string() on the enum if necessary.

pub fn halign_as_string(&self) -> String[src]

Get the horizontal alignment of the text as a string.

pub fn vertical_alignment(&self) -> VAlign[src]

Get the vertical alignment in the form of a VAlign enum. You can call to_string() on the enum if necessary.

pub fn valign_as_string(&self) -> String[src]

Get the vertical alignment of the text as a string.

Trait Implementations

impl Clone for Text[src]

impl Debug for Text[src]

impl<'de> Deserialize<'de> for Text[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.