[][src]Trait piston_window::AdvancedWindow

pub trait AdvancedWindow: Window {
    fn get_title(&self) -> String;
fn set_title(&mut self, value: String);
fn get_exit_on_esc(&self) -> bool;
fn set_exit_on_esc(&mut self, value: bool);
fn get_automatic_close(&self) -> bool;
fn set_automatic_close(&mut self, value: bool);
fn set_capture_cursor(&mut self, value: bool);
fn show(&mut self);
fn hide(&mut self);
fn get_position(&self) -> Option<Position>;
fn set_position<P>(&mut self, val: P)
    where
        P: Into<Position>
;
fn set_size<S>(&mut self, val: S)
    where
        S: Into<Size>
; fn title(self, value: String) -> Self { ... }
fn exit_on_esc(self, value: bool) -> Self { ... }
fn automatic_close(self, value: bool) -> Self { ... }
fn capture_cursor(self, value: bool) -> Self { ... }
fn position<P>(self, val: P) -> Self
    where
        P: Into<Position>
, { ... } }

Trait representing a window with the most features that are still generic.

This trait is implemented by fully featured window back-ends. When possible, reduce the trait constraint to Window to make the code more portable.

The Sized trait is required for method chaining.

Required methods

fn get_title(&self) -> String

Gets a copy of the title of the window.

fn set_title(&mut self, value: String)

Sets the title of the window.

fn get_exit_on_esc(&self) -> bool

Gets whether to exit when pressing esc.

Useful when prototyping.

fn set_exit_on_esc(&mut self, value: bool)

Sets whether to exit when pressing esc.

Useful when prototyping.

fn get_automatic_close(&self) -> bool

Gets whether the window will automatically close when attempting to close it.

Useful when prototyping.

fn set_automatic_close(&mut self, value: bool)

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window.

Useful when prototyping.

fn set_capture_cursor(&mut self, value: bool)

Sets whether to capture/grab the cursor.

This is used to lock and hide cursor to the window, for example in a first-person shooter game.

fn show(&mut self)

Shows the window.

If the platform does not support this, it will have no effect.

fn hide(&mut self)

Hides the window.

If the platform does not support this, it will have no effect.

fn get_position(&self) -> Option<Position>

Gets the position of window.

fn set_position<P>(&mut self, val: P) where
    P: Into<Position>, 

Sets the position of window.

Has no effect if the window no longer has a position.

fn set_size<S>(&mut self, val: S) where
    S: Into<Size>, 

Sets the window size.

Has no effect if the window no longer has a size.

Loading content...

Provided methods

fn title(self, value: String) -> Self

Sets title on window.

This method moves the current window data, unlike set_title(), so that it can be used in method chaining.

fn exit_on_esc(self, value: bool) -> Self

Sets whether to exit when pressing the Esc button.

Useful when prototyping.

This method moves the current window data, unlike set_exit_on_esc(), so that it can be used in method chaining.

fn automatic_close(self, value: bool) -> Self

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window.

Useful when prototyping.

This method moves the current window data, unlike set_automatic_close(), so that it can be used in method chaining.

fn capture_cursor(self, value: bool) -> Self

Sets whether to capture/grab the cursor.

This method moves the current window data, unlike set_capture_cursor(), so that it can be used in method chaining.

fn position<P>(self, val: P) -> Self where
    P: Into<Position>, 

Sets the position of window.

Has no effect if the window no longer has a position.

This method moves the current window data, unlike set_position(), so that it can be used in method chaining.

Loading content...

Implementations on Foreign Types

impl AdvancedWindow for GlutinWindow[src]

fn title(self, value: String) -> Self[src]

fn exit_on_esc(self, value: bool) -> Self[src]

fn automatic_close(self, value: bool) -> Self[src]

fn capture_cursor(self, value: bool) -> Self[src]

fn position<P>(self, val: P) -> Self where
    P: Into<Position>, 
[src]

Loading content...

Implementors

impl AdvancedWindow for NoWindow[src]

fn title(self, value: String) -> Self[src]

fn exit_on_esc(self, value: bool) -> Self[src]

fn automatic_close(self, value: bool) -> Self[src]

fn capture_cursor(self, value: bool) -> Self[src]

fn position<P>(self, val: P) -> Self where
    P: Into<Position>, 
[src]

impl<W> AdvancedWindow for PistonWindow<W> where
    W: AdvancedWindow
[src]

fn title(self, value: String) -> Self[src]

fn exit_on_esc(self, value: bool) -> Self[src]

fn automatic_close(self, value: bool) -> Self[src]

fn capture_cursor(self, value: bool) -> Self[src]

fn position<P>(self, val: P) -> Self where
    P: Into<Position>, 
[src]

Loading content...