logo
pub enum WindowCommand {
Show 17 variants SetWindowMode { mode: WindowMode, resolution: UVec2, }, SetTitle { title: String, }, SetScaleFactor { scale_factor: f64, }, SetResolution { logical_resolution: Vec2, scale_factor: f64, }, SetPresentMode { present_mode: PresentMode, }, SetResizable { resizable: bool, }, SetDecorations { decorations: bool, }, SetCursorLockMode { locked: bool, }, SetCursorIcon { icon: CursorIcon, }, SetCursorVisibility { visible: bool, }, SetCursorPosition { position: Vec2, }, SetMaximized { maximized: bool, }, SetMinimized { minimized: bool, }, SetPosition { position: IVec2, }, Center(MonitorSelection), SetResizeConstraints { resize_constraints: WindowResizeConstraints, }, Close,
}
Expand description

A command to be sent to a window.

Bevy apps don’t interact with this enum directly. Instead, they should use the methods on Window. This enum is meant for authors of windowing plugins. See the documentation on crate::WindowPlugin for more information.

Variants

SetWindowMode

Fields

mode: WindowMode
resolution: UVec2

Set the window’s WindowMode.

SetTitle

Fields

title: String

Set the window’s title.

SetScaleFactor

Fields

scale_factor: f64

Set the window’s scale factor.

SetResolution

Fields

logical_resolution: Vec2
scale_factor: f64

Set the window’s resolution.

SetPresentMode

Fields

present_mode: PresentMode

Set the window’s PresentMode.

SetResizable

Fields

resizable: bool

Set whether or not the window is resizable.

SetDecorations

Fields

decorations: bool

Set whether or not the window has decorations.

Examples of decorations include the close, full screen, and minimize buttons

SetCursorLockMode

Fields

locked: bool

Set whether or not the cursor’s position is locked.

SetCursorIcon

Fields

icon: CursorIcon

Set the cursor’s CursorIcon.

SetCursorVisibility

Fields

visible: bool

Set whether or not the cursor is visible.

SetCursorPosition

Fields

position: Vec2

Set the cursor’s position.

SetMaximized

Fields

maximized: bool

Set whether or not the window is maximized.

SetMinimized

Fields

minimized: bool

Set whether or not the window is minimized.

SetPosition

Fields

position: IVec2

Set the window’s position on the screen.

Center(MonitorSelection)

Modifies the position of the window to be in the center of the current monitor

SetResizeConstraints

Fields

resize_constraints: WindowResizeConstraints

Set the window’s WindowResizeConstraints

Close

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more