Struct tcod::console::Offscreen [] [src]

pub struct Offscreen { /* fields omitted */ }

A type representing secondary consoles

Offscreen consoles allow you draw on secondary consoles as you would on Root consoles, and then blit their contents onto other consoles (including Root). There are some limitations compared to Root consoles, however:

Examples

Creating an Offscreen console

use tcod::console::Offscreen;

let width = 80;
let height = 20;
let offscreen = Offscreen::new(width, height);

Blitting an Offscreen console to the Root console:

use tcod::console as console;
use tcod::console::{Root, Offscreen};

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

    let mut direct = Offscreen::new(20, 20);
    console::blit(&direct, (0, 0), (20, 20), &mut root, (0, 0), 1.0, 1.0);
}

See the documentation for blit for a detailed description of the function parameters and a more in-depth example.

Methods

impl Offscreen
[src]

Creates a new Offscreen console instance

Trait Implementations

impl Drop for Offscreen
[src]

A method called when the value goes out of scope. Read more

impl AsNative<TCOD_console_t> for Offscreen
[src]

impl Console for Offscreen
[src]

Returns the default text alignment for the Console instance. For all the possible text alignment options, see the documentation for TextAlignment. Read more

Sets the default text alignment for the console. For all the possible text alignment options, see the documentation for TextAlignment. Read more

Sets a key color that will be ignored when blitting the contents of this console onto an other (essentially a transparent background color). Read more

Returns the width of the console in characters.

Returns the height of the console in characters.

Return the console's default background color. This is used in several other methods, like: clear, put_char, etc. Read more

Sets the console's default background color. This is used in several other methods, like: clear, put_char, etc. Read more

Sets the console's default foreground color. This is used in several printing functions.

Returns the background color of the cell at the specified coordinates.

Returns the foreground color of the cell at the specified coordinates.

Returns the console's current background flag. For a detailed explanation of the possible values, see BackgroundFlag. Read more

Sets the console's current background flag. For a detailed explanation of the possible values, see BackgroundFlag. Read more

Returns the ASCII value of the cell located at x, y

Modifies the ASCII value of the cell located at x, y.

Changes the background color of the specified cell

Changes the foreground color of the specified cell

This function modifies every property of the given cell: Read more

Updates every propert of the given cell using explicit colors for the background and foreground. Read more

Clears the console with its default background color

Prints the text at the specified location. The position of the x and y coordinates depend on the TextAlignment set in the console: Read more

Prints the text at the specified location in a rectangular area with the dimensions: (width; height). If the text is longer than the width the newlines will be inserted. Read more

Prints the text at the specified location with an explicit BackgroundFlag and TextAlignment. Read more

Combines the functions of print_ex and print_rect

Compute the height of a wrapped text printed using print_rect or print_rect_ex.

Fill a rectangle with the default background colour. Read more

Draw a horizontal line. Read more

Draw a vertical line. Read more

Draw a window frame with an optional title. Read more