[−][src]Struct bevy_window::Window
An operating system window that can present content and receive user input.
Window Sizes
There are three sizes associated with a window. The physical size which is the height and width in physical pixels on the monitor. The logical size which is the physical size scaled by an operating system provided factor to account for monitors with differing pixel densities or user preference. And the requested size, measured in logical pixels, which is the value submitted to the API when creating the window, or requesting that it be resized.
The actual size, in logical pixels, of the window may not match the requested size due to operating system limits on the window size, or the quantization of the logical size when converting the physical size to the logical size through the scaling factor.
Implementations
impl Window
[src]
pub fn new(
id: WindowId,
window_descriptor: &WindowDescriptor,
physical_width: u32,
physical_height: u32,
scale_factor: f64
) -> Self
[src]
id: WindowId,
window_descriptor: &WindowDescriptor,
physical_width: u32,
physical_height: u32,
scale_factor: f64
) -> Self
pub fn id(&self) -> WindowId
[src]
pub fn width(&self) -> f32
[src]
The current logical width of the window's client area.
pub fn height(&self) -> f32
[src]
The current logical height of the window's client area.
pub fn requested_width(&self) -> f32
[src]
The requested window client area width in logical pixels from window creation or the last call to set_resolution.
This may differ from the actual width depending on OS size limits and the scaling factor for high DPI monitors.
pub fn requested_height(&self) -> f32
[src]
The requested window client area height in logical pixels from window creation or the last call to set_resolution.
This may differ from the actual width depending on OS size limits and the scaling factor for high DPI monitors.
pub fn physical_width(&self) -> u32
[src]
The window's client area width in physical pixels.
pub fn physical_height(&self) -> u32
[src]
The window's client area height in physical pixels.
pub fn set_maximized(&mut self, maximized: bool)
[src]
pub fn set_resolution(&mut self, width: f32, height: f32)
[src]
Request the OS to resize the window such the the client area matches the specified width and height.
pub fn update_scale_factor_from_backend(&mut self, scale_factor: f64)
[src]
pub fn update_actual_size_from_backend(
&mut self,
physical_width: u32,
physical_height: u32
)
[src]
&mut self,
physical_width: u32,
physical_height: u32
)
pub fn scale_factor(&self) -> f64
[src]
The ratio of physical pixels to logical pixels
physical_pixels = logical_pixels * scale_factor
pub fn title(&self) -> &str
[src]
pub fn set_title(&mut self, title: String)
[src]
pub fn vsync(&self) -> bool
[src]
pub fn set_vsync(&mut self, vsync: bool)
[src]
pub fn resizable(&self) -> bool
[src]
pub fn set_resizable(&mut self, resizable: bool)
[src]
pub fn decorations(&self) -> bool
[src]
pub fn set_decorations(&mut self, decorations: bool)
[src]
pub fn cursor_locked(&self) -> bool
[src]
pub fn set_cursor_lock_mode(&mut self, lock_mode: bool)
[src]
pub fn cursor_visible(&self) -> bool
[src]
pub fn set_cursor_visibility(&mut self, visibile_mode: bool)
[src]
pub fn cursor_position(&self) -> Option<Vec2>
[src]
pub fn set_cursor_position(&mut self, position: Vec2)
[src]
pub fn update_cursor_position_from_backend(
&mut self,
cursor_position: Option<Vec2>
)
[src]
&mut self,
cursor_position: Option<Vec2>
)
pub fn mode(&self) -> WindowMode
[src]
pub fn set_mode(&mut self, mode: WindowMode)
[src]
pub fn drain_commands(&mut self) -> impl Iterator<Item = WindowCommand> + '_
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Window
[src]
impl Send for Window
[src]
impl Sync for Window
[src]
impl Unpin for Window
[src]
impl UnwindSafe for Window
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: 'static + Send + Sync,
[src]
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: 'static + Send + Sync,
[src]
T: 'static + Send + Sync,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,