Struct bevy::window::WindowPlugin
pub struct WindowPlugin {
pub window: WindowDescriptor,
pub add_primary_window: bool,
pub exit_on_all_closed: bool,
pub close_when_requested: bool,
}
Expand description
A Plugin
that defines an interface for windowing support in Bevy.
Fields§
§window: WindowDescriptor
§add_primary_window: bool
Whether to create a window when added.
Note that if there are no windows, by default the App will exit,
due to exit_on_all_closed
.
exit_on_all_closed: bool
Whether to exit the app when there are no open windows.
If disabling this, ensure that you send the [bevy_app::AppExit
]
event when the app should exit. If this does not occur, you will
create ‘headless’ processes (processes without windows), which may
surprise your users. It is recommended to leave this setting as true
.
If true, this plugin will add exit_on_all_closed
to CoreStage::PostUpdate
.
close_when_requested: bool
Whether to close windows when they are requested to be closed (i.e. when the close button is pressed).
If true, this plugin will add close_when_requested
to CoreStage::Update
.
If this system (or a replacement) is not running, the close button will have no effect.
This may surprise your users. It is recommended to leave this setting as true
.
Trait Implementations§
§impl Default for WindowPlugin
impl Default for WindowPlugin
§fn default() -> WindowPlugin
fn default() -> WindowPlugin
§impl Plugin for WindowPlugin
impl Plugin for WindowPlugin
Auto Trait Implementations§
impl RefUnwindSafe for WindowPlugin
impl Send for WindowPlugin
impl Sync for WindowPlugin
impl Unpin for WindowPlugin
impl UnwindSafe for WindowPlugin
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist. Read more§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more§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. Read more§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. Read more§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World