Trait piston::AdvancedWindow [−][src]
pub trait AdvancedWindow: Window {}Show methods
pub fn get_title(&self) -> String; pub fn set_title(&mut self, value: String); pub fn get_exit_on_esc(&self) -> bool; pub fn set_exit_on_esc(&mut self, value: bool); pub fn get_automatic_close(&self) -> bool; pub fn set_automatic_close(&mut self, value: bool); pub fn set_capture_cursor(&mut self, value: bool); pub fn show(&mut self); pub fn hide(&mut self); pub fn get_position(&self) -> Option<Position>; pub fn set_position<P>(&mut self, val: P)
where
P: Into<Position>; pub fn set_size<S>(&mut self, val: S)
where
S: Into<Size>; pub fn title(self, value: String) -> Self { ... } pub fn exit_on_esc(self, value: bool) -> Self { ... } pub fn automatic_close(self, value: bool) -> Self { ... } pub fn capture_cursor(self, value: bool) -> Self { ... } pub 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
pub fn get_title(&self) -> String
[src]
Gets a copy of the title of the window.
pub fn set_title(&mut self, value: String)
[src]
Sets the title of the window.
pub fn get_exit_on_esc(&self) -> bool
[src]
Gets whether to exit when pressing esc.
Useful when prototyping.
pub fn set_exit_on_esc(&mut self, value: bool)
[src]
Sets whether to exit when pressing esc.
Useful when prototyping.
pub fn get_automatic_close(&self) -> bool
[src]
Gets whether the window will automatically close when attempting to close it.
Useful when prototyping.
pub fn set_automatic_close(&mut self, value: bool)
[src]
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.
pub fn set_capture_cursor(&mut self, value: bool)
[src]
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.
pub fn show(&mut self)
[src]
Shows the window.
If the platform does not support this, it will have no effect.
pub fn hide(&mut self)
[src]
Hides the window.
If the platform does not support this, it will have no effect.
pub fn get_position(&self) -> Option<Position>
[src]
Gets the position of window.
pub fn set_position<P>(&mut self, val: P) where
P: Into<Position>,
[src]
P: Into<Position>,
Sets the position of window.
Has no effect if the window no longer has a position.
pub fn set_size<S>(&mut self, val: S) where
S: Into<Size>,
[src]
S: Into<Size>,
Sets the window size.
Has no effect if the window no longer has a size.
Provided methods
pub fn title(self, value: String) -> Self
[src]
Sets title on window.
This method moves the current window data,
unlike set_title()
, so
that it can be used in method chaining.
pub fn exit_on_esc(self, value: bool) -> Self
[src]
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.
pub fn automatic_close(self, value: bool) -> Self
[src]
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.
pub fn capture_cursor(self, value: bool) -> Self
[src]
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.
pub fn position<P>(self, val: P) -> Self where
P: Into<Position>,
[src]
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.
Implementors
impl AdvancedWindow for NoWindow
[src]
pub fn get_title(&self) -> String
[src]
pub fn set_title(&mut self, value: String)
[src]
pub fn get_exit_on_esc(&self) -> bool
[src]
pub fn set_exit_on_esc(&mut self, _value: bool)
[src]
pub fn get_automatic_close(&self) -> bool
[src]
pub fn set_automatic_close(&mut self, value: bool)
[src]
pub fn set_capture_cursor(&mut self, _value: bool)
[src]
pub fn show(&mut self)
[src]
pub fn hide(&mut self)
[src]
pub fn get_position(&self) -> Option<Position>
[src]
pub fn set_position<P>(&mut self, val: P) where
P: Into<Position>,
[src]
P: Into<Position>,
pub fn set_size<S>(&mut self, val: S) where
S: Into<Size>,
[src]
S: Into<Size>,