/// Blits the contents of one console onto an other
///
/// It takes a region from a given console (with an arbitrary location, width and height) and superimposes
/// it on the destination console (at the given location).
/// Note that when blitting, the source console's key color (set by `set_key_color`) will
/// be ignored, making it possible to blit non-rectangular regions.
///
/// # Arguments
///
/// * `source_console`: the type implementing the [Console](./trait.Console.html) trait we want to
/// take the blitted region from
/// * `source_x`, `source_y`: the coordinates of the blitted region's top left corner on the source
/// console
/// * `source_width`, `source_height`: the width and height of the blitted region. With a value of
/// 0, the width and height of the source console will be used.
/// * `destination_console`: the type implementing the [Console](./trait.Console.html) trait we want
/// to blit to
/// * `destination_x`, `destination_y`: the coordinated of the blitted region's top left corner on
/// the destination console
/// * `foreground_alpha`, `background_alpha`: the foreground and background opacity
///
/// # Examples
///
/// Using `blit` with concrete types and `Console` trait objects:
///
/// ```no_run
/// use tcod::console as console;
/// use tcod::console::{Console, Root, Offscreen};
///
/// fn main() {
///     let mut root = Root::initializer().init();
///
///     let mut direct = Offscreen::new(20, 20);
///     let mut boxed_direct = Box::new(Offscreen::new(20, 20));
///     let mut trait_object: &Console = &Offscreen::new(20, 20);
///     let mut boxed_trait: Box<Console> = Box::new(Offscreen::new(20, 20));
///
///     console::blit(&direct, (0, 0), (20, 20), &mut root, (0, 0), 1.0, 1.0);
///     console::blit(&boxed_direct, (0, 0), (20, 20), &mut root, (20, 0), 1.0, 1.0);
///     console::blit(&trait_object, (0, 0), (20, 20), &mut root, (0, 20), 1.0, 1.0);
///     console::blit(&boxed_trait, (0, 0), (20, 20), &mut root, (20, 20), 1.0, 1.0);
/// }
///
/// ```
Blits the contents of one console onto an other
It takes a region from a given console (with an arbitrary location, width and height) and superimposes
it on the destination console (at the given location).
Note that when blitting, the source console's key color (set by `set_key_color`) will
be ignored, making it possible to blit non-rectangular regions.
Blits the contents of one console onto an other It takes a region from a given console ( with an arbitrary location width and height ) and superimposes it on the destination console ( at the given location ) . Note that when blitting the source console ' s key color ( set by ` set_key_color ` ) will be ignored making it possible to blit non - rectangular regions .
pub fn blit<T, U>(source_console: &T,
                  (source_x, source_y): (i32, i32),
                  (source_width, source_height): (i32, i32),
                  destination_console: &mut U,
                  (destination_x, destination_y): (i32, i32),
                  foreground_alpha: f32, background_alpha: f32)
    where T: Console,
          U: Console {
    assert!(source_x >= 0 && source_y >= 0 &&
            source_width >= 0 && source_height >= 0); // If width or height is 0, the source width/height is used.
    unsafe {
        ffi::TCOD_console_blit(*source_console.as_native(),
                               source_x, source_y, source_width, source_height,
                               *destination_console.as_native(),
                               destination_x, destination_y,
                               foreground_alpha, background_alpha);
    }
}
pub fn blit < T , U > ( source_console : & T , ( source_x , source_y ) : ( i32 , i32 ) , ( source_width , source_height ) : ( i32 , i32 ) , destination_console : & mut U , ( destination_x , destination_y ) : ( i32 , i32 ) , foreground_alpha : f32 , background_alpha : f32 ) where T : Console , U : Console { assert ! ( source_x 0 source_y 0 source_width 0 source_height 0 ) ; // If width or height is 0, the source width/height is used. unsafe { ffi :: TCOD_console_blit ( * source_console . as_native ( ) , source_x , source_y , source_width , source_height , * destination_console . as_native ( ) , destination_x , destination_y , foreground_alpha , background_alpha ) ; } }
Blits the contents of one console onto an other
It takes a region from a given console (with an arbitrary location, width and height) and superimposes
it on the destination console (at the given location).
Blits the contents of one console onto an other It takes a region from a given console ( with an arbitrary location width and height ) and superimposes it on the destination console ( at the given location ) .
source_console
(i32, i32)
destination_console
(i32, i32)
foreground_alpha
f32
background_alpha
f32
examples
Using `blit` with concrete types and `Console` trait objects.

```no_run
use tcod::console as console;
use tcod::console::{Console, Root, Offscreen}.

fn main() {
let mut root = Root::initializer().init().

let mut direct = Offscreen::new(20, 20);
let mut boxed_direct = Box::new(Offscreen::new(20, 20));
let mut trait_object: &Console = &Offscreen::new(20, 20);
let mut boxed_trait: Box = Box::new(Offscreen::new(20, 20)).




Using ` blit ` with concrete types and ` Console ` trait objects . ` ` ` no_run use tcod :: console as console ; use tcod :: console :: { Console Root Offscreen } . fn main () { let mut root = Root :: initializer () . init () . let mut direct = Offscreen :: new ( 20 20 ) ; let mut boxed_direct = Box :: new ( Offscreen :: new ( 20 20 )) ; let mut trait_object : &Console = &Offscreen :: new ( 20 20 ) ; let mut boxed_trait : Box = Box :: new ( Offscreen :: new ( 20 20 )) .