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.

Be careful when using this code, it's not being tested!
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]

[src]

Construct a new, empty image::Map.

[src]

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.

[src]

Inserts the given image into the map, returning its associated image::Id. The user must store the returned image::Id in order to use, modify or remove the inserted image.

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

[src]

Replaces the given image in the map if it exists. Returns the image or None.

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

[src]

Removes the given image from the map if it exists. Returns the image or None.

Any future use of the given image::Id will be invalid.

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

[src]

Insert each of the images yielded by the given iterator and produce an iterator yielding their generated Ids in the same order.

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.

[src]

Dereferences the value.