Struct tcod::console::RootInitializer [] [src]

pub struct RootInitializer<'a> { /* fields omitted */ }

Helper struct for the Root console initialization

This is the type that should be used to initialize the Root console (either directly or indirectly, by calling Root::initializer). It uses method chaining to provide an easy-to-use interface. It exposes the following configuration options for the Root console:

The initializer provides sane defaults even there are no options explicitly specified, but it is recommended to at least set the size and the window title.

Examples

Initializing the Root console using Root::initializer instead of explicitly creating a RootInitializer instance:

use tcod::console::{Root, FontLayout, Renderer};

fn main() {
    let mut root = Root::initializer()
        .size(80, 20)
        .title("Example")
        .fullscreen(true)
        .font("terminal.png", FontLayout::AsciiInCol)
        .renderer(Renderer::GLSL)
        .init();
}

Methods

impl<'a> RootInitializer<'a>
[src]