Struct conrod::image::Map [] [src]

pub struct Map<Img> {
    pub trigger_redraw: Cell<bool>,
    // some fields omitted
}

A type used to map the widget::Id of Image widgets to their associated Img data.

The image::Map type is usually instantiated and loaded during the "setup" stage of the application before the main loop begins. A macro is provided to simplify the construction of maps with multiple images.

let image_map = image_map! {
    (RUST_LOGO, try!(image::open("rust-logo.png"))),
    (CAT_PIC, try!(image::open("floof.jpeg"))),
};

Fields

Whether or not the image::Map will trigger a redraw the next time Ui::draw is called.

This is automatically set to true when any method that takes &mut self is called.

Methods

impl<Img> Map<Img>
[src]

Construct a new, empty image::Map.

Uniquely borrow the Img associated with the given widget.

Note: Calling this will trigger a redraw the next time Ui::draw_if_changed is called.

Inserts the given widget-image pair into the map.

If the map did not already have an image associated with this widget, None is returned.

If the map did already have an image associated with this widget, the old value is removed from the map and returned.

Note: Calling this will trigger a redraw the next time Ui::draw_if_changed is called.

Trait Implementations

impl<Img> Deref for Map<Img>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<Img> Extend<(Id, Img)> for Map<Img>
[src]

Extends a collection with the contents of an iterator. Read more