Struct bevy_persistent_windows::components::WindowState
source · pub struct WindowState {
pub mode: WindowMode,
pub monitor: Option<String>,
pub resolution: Option<(u32, u32)>,
pub scale: Option<f64>,
pub position: Option<(i32, i32)>,
/* private fields */
}Expand description
Window state.
Fields§
§mode: WindowModeMode of the window.
monitor: Option<String>Name of the monitor that the window is in.
(None means pick the best monitor)
resolution: Option<(u32, u32)>Resolution of the window.
(None means pick the best resolution)
scale: Option<f64>Scale of the window.
(None means pick the best scale)
position: Option<(i32, i32)>Position of the window.
(None means centered)
Implementations§
source§impl WindowState
impl WindowState
sourcepub fn borderless_fullscreen() -> WindowState
pub fn borderless_fullscreen() -> WindowState
Creates a borderless fullscreen state.
sourcepub fn fullscreen() -> WindowState
pub fn fullscreen() -> WindowState
Creates a fullscreen state.
sourcepub fn sized_fullscreen() -> WindowState
pub fn sized_fullscreen() -> WindowState
Creates a sized fullscreen state.
sourcepub fn windowed(width: u32, height: u32) -> WindowState
pub fn windowed(width: u32, height: u32) -> WindowState
Creates a windowed state with given resolution.
source§impl WindowState
impl WindowState
sourcepub fn at(self, x: i32, y: i32) -> WindowState
pub fn at(self, x: i32, y: i32) -> WindowState
Adds position information to the state.
sourcepub fn scaled(self, scale: f64) -> WindowState
pub fn scaled(self, scale: f64) -> WindowState
Adds scale information to the state.
Trait Implementations§
source§impl Clone for WindowState
impl Clone for WindowState
source§fn clone(&self) -> WindowState
fn clone(&self) -> WindowState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Component for WindowStatewhere
Self: Send + Sync + 'static,
impl Component for WindowStatewhere Self: Send + Sync + 'static,
source§impl Debug for WindowState
impl Debug for WindowState
source§impl Default for WindowState
impl Default for WindowState
source§fn default() -> WindowState
fn default() -> WindowState
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for WindowStatewhere
WindowState: Default,
impl<'de> Deserialize<'de> for WindowStatewhere WindowState: Default,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for WindowState
impl PartialEq for WindowState
source§fn eq(&self, other: &WindowState) -> bool
fn eq(&self, other: &WindowState) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for WindowState
impl Serialize for WindowState
impl Resource for WindowStatewhere Self: Send + Sync + 'static,
impl StructuralPartialEq for WindowState
Auto Trait Implementations§
impl RefUnwindSafe for WindowState
impl Send for WindowState
impl Sync for WindowState
impl Unpin for WindowState
impl UnwindSafe for WindowState
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
Return the
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist.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
Mutably borrows from an owned value. Read more
§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> Cwhere F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>,
§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>
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>
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)
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)
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<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§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
Creates
Self using data from the given [World].