[][src]Struct ggez::graphics::Text

pub struct Text { /* fields omitted */ }

Drawable text object. Essentially a list of TextFragment's and some metrics information.

It implements Drawable so it can be drawn immediately with graphics::draw(), or many of them can be queued with graphics::queue_text() and then all drawn at once with graphics::draw_queued_text().

Methods

impl Text
[src]

Creates a Text from a TextFragment.

let text = Text::new("foo");

Appends a TextFragment to the Text.

Returns a read-only slice of all TextFragment's.

Returns a mutable slice with all fragments.

Specifies rectangular dimensions to try and fit contents inside of, by wrapping, and alignment within the bounds. To disable wrapping, give it a layout with f32::INF for the x value.

Specifies text's font and font scale; used for fragments that don't have their own.

Returns the string that the text represents.

Returns the width and height of the formatted and wrapped text.

Returns the width of formatted and wrapped text, in screen coordinates.

Returns the height of formatted and wrapped text, in screen coordinates.

Trait Implementations

impl Drawable for Text
[src]

impl Clone for Text
[src]

This has to be explicit. Derived Clone clones the Arc, so clones end up sharing the metrics instead of the proper behavior which is to have different ones for each Text object, since Text may be mutated.

TODO: Can we just ditch the Arc entirely then?

Performs copy-assignment from source. Read more

impl Default for Text
[src]

impl Debug for Text
[src]

Auto Trait Implementations

impl Send for Text

impl Sync for Text

Blanket Implementations

impl<T> From for T
[src]

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> SetParameter for T

Sets value as a parameter of self.

impl<T> Erased for T

impl<T> Same for T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,