Struct ggez::graphics::TextCached[][src]

pub struct TextCached { /* fields omitted */ }

Drawable text. Can be either monolithic, or consist of differently-formatted fragments.

Methods

impl TextCached
[src]

Creates a TextCached from a TextFragment.

Creates an empty TextCached.

Appends a TextFragment.

Replaces a TextFragment without having to rebuild the entire TextCached. Useful for things like animating specific words, or highlighting them on mouseover.

Important traits for &'a [u8]

Returns a slice with all fragments, for reading.

Specifies rectangular dimensions to try and fit contents inside of, by wrapping. Alignment within bounds can be changed by passing a Layout; defaults to top left corner.

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 of formatted and wrapped text, in screen coordinates.

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

Queues the TextCached to be drawn by draw_queued(). relative_dest is relative to the DrawParam::dest passed to draw_queued(). Note, any TextCached drawn via graphics::draw() will also draw the queue.

Exposes gfx_glyph's GlyphBrush::queue() and GlyphBrush::queue_custom_layout(), in case ggez' API is insufficient.

Draws all of queue()d TextCached. DrawParam apply to everything in the queue; offset is in screen coordinates; color is ignored - specify it when queue()ing instead.

Trait Implementations

impl Debug for TextCached
[src]

Formats the value using the given formatter. Read more

impl Clone for TextCached
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for TextCached
[src]

Returns the "default value" for a type. Read more

impl Drawable for TextCached
[src]

Actually draws the object to the screen. Read more

Sets the blend mode to be used when drawing this drawable. This overrides the general graphics::set_blend_mode(). If None is set, defers to the blend mode set by graphics::set_blend_mode(). Read more

Gets the blend mode to be used when drawing this drawable.

Draws the drawable onto the rendering target. Read more

Auto Trait Implementations

impl Send for TextCached

impl Sync for TextCached