Struct let_engine::prelude::Window

source ·
pub struct Window { /* private fields */ }
Expand description

A struct representing the window.

Implementations§

source§

impl Window

source

pub fn request_redraw(&self)

Requests the window to be redrawn.

source

pub fn inner_size(&self) -> Vec2

Returns the inner size of the window in pixels.

source

pub fn set_inner_size(&self, size: Vec2)

Sets the size of the window in pixels. This unmaximizes the window in case it is.

source

pub fn outer_size(&self) -> Vec2

Returns the outer size of the window in pixels.

source

pub fn set_min_inner_size(&self, size: Option<Vec2>)

Restricts the window to not go smaller than the given size in pixels.

source

pub fn set_max_inner_size(&self, size: Option<Vec2>)

Restricts the window to not go bigger than the given size in pixels.

source

pub fn resize_increments(&self) -> Option<Vec2>

Returns the increments in which the window gets resized in pixels.

source

pub fn set_resize_increments(&self, increments: Option<Vec2>)

Sets the increments in which the window gets resized in pixels.

source

pub fn title(&self) -> String

Returns the title of the window.

source

pub fn set_title(&self, title: &str)

Sets the title of the window.

source

pub fn set_visible(&self, visible: bool)

Sets whether the window should be visible.

source

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.

source

pub fn set_resizable(&self, resizable: bool)

Sets whether the window should be resizable.

source

pub fn resizable(&self) -> bool

Returns whether the window is resizable.

source

pub fn set_enabled_buttons(&self, close: bool, minimize: bool, maximize: bool)

Sets the enabled_buttons of the title bar.

source

pub fn enabled_buttons(&self) -> (bool, bool, bool)

Returns the enabled buttons on the title bar. (bool, bool, bool) -> close, minimize, maximize buttons

source

pub fn set_minimized(&self, minimized: bool)

Sets whether the window should be minimized.

source

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.

source

pub fn set_maximized(&self, maximized: bool)

Sets whether the window should be maximized.

source

pub fn maximized(&self) -> bool

Returns whether the window is maximized.

source

pub fn set_fullscreen(&self, fullscreen: bool)

Sets whether the window should be in fullscreen.

source

pub fn fullscreen(&self) -> bool

Returns whether the window is fullscreen.

source

pub fn set_decorations(&self, decorations: bool)

Sets whether the window should have a title bar.

source

pub fn decorated(&self) -> bool

Returns whether the window has a title bar.

source

pub fn set_window_level(&self, level: WindowLevel)

Sets the window level.

source

pub fn set_window_icon(&self, icon: Option<Icon>)

Sets the window icon.

source

pub fn focus(&self)

Focuses the window.

source

pub fn has_focus(&self) -> bool

Returns true if the window is focused.

source

pub fn request_user_attention(&self, request_type: Option<UserAttentionType>)

Makes the window request for user attention with the given context.

source

pub fn set_cursor_icon(&self, cursor: CursorIcon)

Sets the cursor icon to be the given variant.

source

pub fn set_cursor_grab(&self, mode: CursorGrabMode) -> Result<(), ExternalError>

Makes the window grab the cursor. Some variants don’t work on some platforms.

source

pub fn set_cursor_visible( &self, mode: CursorGrabMode ) -> Result<(), ExternalError>

Makes the cursor invisible mostly just within the confines of the window.

source

pub fn drag_window(&self) -> Result<(), ExternalError>

Drags the window with the left mouse button until it’s released.

source

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.

source

pub fn set_clear_color(&self, color: impl Into<Color>)

Sets the clear color of the window.

source

pub fn clear_color(&self) -> Color

Trait Implementations§

source§

impl Debug for Window

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<(Arc<Window>, bool)> for Window

source§

fn from(value: (Arc<Window>, bool)) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,