[][src]Struct tetra::ContextBuilder

pub struct ContextBuilder { /* fields omitted */ }

Settings that can be configured when starting up a game.

Methods

impl ContextBuilder[src]

pub fn new<S>(title: S, window_width: i32, window_height: i32) -> ContextBuilder where
    S: Into<String>, 
[src]

Create a new ContextBuilder, with a title and window size.

pub fn title<S>(&mut self, title: S) -> &mut ContextBuilder where
    S: Into<String>, 
[src]

Sets the title of the window.

Defaults to "Tetra".

pub fn size(&mut self, width: i32, height: i32) -> &mut ContextBuilder[src]

Sets the size of the window.

Defaults to 1280 by 720.

pub fn vsync(&mut self, vsync: bool) -> &mut ContextBuilder[src]

Enables or disables vsync.

Defaults to true.

pub fn timestep(&mut self, timestep: Timestep) -> &mut ContextBuilder[src]

Sets the game's timestep.

Defaults to Timestep::Fixed(60.0).

pub fn fullscreen(&mut self, fullscreen: bool) -> &mut ContextBuilder[src]

Sets whether or not the window should start in fullscreen.

Defaults to false.

pub fn maximized(&mut self, maximized: bool) -> &mut ContextBuilder[src]

Sets whether or not the window should start maximized.

Defaults to false.

pub fn minimized(&mut self, minimized: bool) -> &mut ContextBuilder[src]

Sets whether or not the window should start minimized.

Defaults to false.

pub fn resizable(&mut self, resizable: bool) -> &mut ContextBuilder[src]

Sets whether or not the window should be resizable.

Defaults to false.

pub fn borderless(&mut self, borderless: bool) -> &mut ContextBuilder[src]

Sets whether or not the window should be borderless.

Defaults to false.

pub fn show_mouse(&mut self, show_mouse: bool) -> &mut ContextBuilder[src]

Sets whether or not the mouse cursor should be visible when it is within the game window.

Defaults to false.

pub fn quit_on_escape(&mut self, quit_on_escape: bool) -> &mut ContextBuilder[src]

Sets whether or not the game should close when the Escape key is pressed.

Defaults to false.

pub fn debug_info(&mut self, debug_info: bool) -> &mut ContextBuilder[src]

Sets whether or not the game should print out debug info at startup. Please include this if you're submitting a bug report!

pub fn build(&self) -> Result<Context>[src]

Builds the context.

Errors

  • TetraError::PlatformError will be returned if the context cannot be initialized.

Trait Implementations

impl Clone for ContextBuilder[src]

impl Debug for ContextBuilder[src]

impl Default for ContextBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,