Struct let_engine::prelude::Window
source · pub struct Window { /* private fields */ }Expand description
A struct representing the window.
Implementations§
source§impl Window
impl Window
sourcepub fn request_redraw(&self)
pub fn request_redraw(&self)
Requests the window to be redrawn.
sourcepub fn inner_size(&self) -> Vec2
pub fn inner_size(&self) -> Vec2
Returns the inner size of the window in pixels.
sourcepub fn set_inner_size(&self, size: Vec2)
pub fn set_inner_size(&self, size: Vec2)
Sets the size of the window in pixels. This unmaximizes the window in case it is.
sourcepub fn outer_size(&self) -> Vec2
pub fn outer_size(&self) -> Vec2
Returns the outer size of the window in pixels.
sourcepub fn set_min_inner_size(&self, size: Option<Vec2>)
pub fn set_min_inner_size(&self, size: Option<Vec2>)
Restricts the window to not go smaller than the given size in pixels.
sourcepub fn set_max_inner_size(&self, size: Option<Vec2>)
pub fn set_max_inner_size(&self, size: Option<Vec2>)
Restricts the window to not go bigger than the given size in pixels.
sourcepub fn resize_increments(&self) -> Option<Vec2>
pub fn resize_increments(&self) -> Option<Vec2>
Returns the increments in which the window gets resized in pixels.
sourcepub fn set_resize_increments(&self, increments: Option<Vec2>)
pub fn set_resize_increments(&self, increments: Option<Vec2>)
Sets the increments in which the window gets resized in pixels.
sourcepub fn set_visible(&self, visible: bool)
pub fn set_visible(&self, visible: bool)
Sets whether the window should be visible.
sourcepub fn visible(&self) -> Option<bool>
pub fn visible(&self) -> Option<bool>
Returns whether the window is visible.
None means it can’t be determined if the window is visible or not.
sourcepub fn set_resizable(&self, resizable: bool)
pub fn set_resizable(&self, resizable: bool)
Sets whether the window should be resizable.
Sets the enabled_buttons of the title bar.
Returns the enabled buttons on the title bar. (bool, bool, bool) -> close, minimize, maximize buttons
sourcepub fn set_minimized(&self, minimized: bool)
pub fn set_minimized(&self, minimized: bool)
Sets whether the window should be minimized.
sourcepub fn minimized(&self) -> Option<bool>
pub fn minimized(&self) -> Option<bool>
Returns whether the window is minimized.
None gets returned if it couldn’d be determined if the window is minimized.
sourcepub fn set_maximized(&self, maximized: bool)
pub fn set_maximized(&self, maximized: bool)
Sets whether the window should be maximized.
sourcepub fn set_fullscreen(&self, fullscreen: bool)
pub fn set_fullscreen(&self, fullscreen: bool)
Sets whether the window should be in fullscreen.
sourcepub fn fullscreen(&self) -> bool
pub fn fullscreen(&self) -> bool
Returns whether the window is fullscreen.
sourcepub fn set_decorations(&self, decorations: bool)
pub fn set_decorations(&self, decorations: bool)
Sets whether the window should have a title bar.
sourcepub fn set_window_level(&self, level: WindowLevel)
pub fn set_window_level(&self, level: WindowLevel)
Sets the window level.
sourcepub fn set_window_icon(&self, icon: Option<Icon>)
pub fn set_window_icon(&self, icon: Option<Icon>)
Sets the window icon.
sourcepub fn request_user_attention(&self, request_type: Option<UserAttentionType>)
pub fn request_user_attention(&self, request_type: Option<UserAttentionType>)
Makes the window request for user attention with the given context.
sourcepub fn set_cursor_icon(&self, cursor: CursorIcon)
pub fn set_cursor_icon(&self, cursor: CursorIcon)
Sets the cursor icon to be the given variant.
sourcepub fn set_cursor_grab(&self, mode: CursorGrabMode) -> Result<(), ExternalError>
pub fn set_cursor_grab(&self, mode: CursorGrabMode) -> Result<(), ExternalError>
Makes the window grab the cursor. Some variants don’t work on some platforms.
sourcepub fn set_cursor_visible(
&self,
mode: CursorGrabMode
) -> Result<(), ExternalError>
pub fn set_cursor_visible( &self, mode: CursorGrabMode ) -> Result<(), ExternalError>
Makes the cursor invisible mostly just within the confines of the window.
sourcepub fn drag_window(&self) -> Result<(), ExternalError>
pub fn drag_window(&self) -> Result<(), ExternalError>
Drags the window with the left mouse button until it’s released.
sourcepub fn set_cursor_hittest(&self, hittest: bool) -> Result<(), ExternalError>
pub fn set_cursor_hittest(&self, hittest: bool) -> Result<(), ExternalError>
Modifies whether the window catches cursor events.
If true, the window will catch the cursor events. If false, events are passed through the window such that any other window behind it receives them. By default hittest is enabled.
sourcepub fn set_clear_color(&self, color: impl Into<Color>)
pub fn set_clear_color(&self, color: impl Into<Color>)
Sets the clear color of the window.
pub fn clear_color(&self) -> Color
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.