pub struct WindowOptions {
pub title: String,
pub inner_size: (f64, f64),
pub min_size: Option<(f64, f64)>,
pub resizable: bool,
pub maximized: bool,
pub fullscreen: bool,
pub icon: Option<(u32, u32, Vec<u8>)>,
pub fonts: Vec<(FamilyRole, Vec<u8>)>,
}Expand description
Options for the application window.
Fields§
§title: StringWindow title.
inner_size: (f64, f64)Initial inner size in logical pixels.
min_size: Option<(f64, f64)>Minimum inner size in logical pixels.
resizable: boolWhether the window can be resized (true by default).
maximized: boolOpen maximized.
fullscreen: boolOpen borderless-fullscreen on the current monitor.
icon: Option<(u32, u32, Vec<u8>)>Window icon as straight-alpha RGBA8 (width, height, pixels).
fonts: Vec<(FamilyRole, Vec<u8>)>Custom faces registered on the runner’s fonts before the first frame: design languages work in windows, not just headlessly.
Implementations§
Source§impl WindowOptions
impl WindowOptions
Sourcepub fn titled(title: impl Into<String>) -> Self
pub fn titled(title: impl Into<String>) -> Self
A window with the given title and the default 1024x768 logical size.
Sourcepub fn with_size(self, width: f64, height: f64) -> Self
pub fn with_size(self, width: f64, height: f64) -> Self
Sets the initial inner size in logical pixels.
Sourcepub fn with_min_size(self, width: f64, height: f64) -> Self
pub fn with_min_size(self, width: f64, height: f64) -> Self
Sets the minimum inner size in logical pixels.
Sourcepub fn with_resizable(self, resizable: bool) -> Self
pub fn with_resizable(self, resizable: bool) -> Self
Allows or forbids resizing (allowed by default).
Sourcepub fn fullscreen(self) -> Self
pub fn fullscreen(self) -> Self
Opens borderless-fullscreen on the current monitor.
Sourcepub fn with_icon(self, width: u32, height: u32, rgba: Vec<u8>) -> Self
pub fn with_icon(self, width: u32, height: u32, rgba: Vec<u8>) -> Self
Sets the window icon from straight-alpha RGBA8 pixels (ignored on platforms without window icons, including the web).
Sourcepub fn with_font(self, role: FamilyRole, data: Vec<u8>) -> Self
pub fn with_font(self, role: FamilyRole, data: Vec<u8>) -> Self
Registers a custom face under a family role for this window’s
fonts (TTF/OTF bytes; see Fonts::register).
Trait Implementations§
Source§impl Clone for WindowOptions
impl Clone for WindowOptions
Source§fn clone(&self) -> WindowOptions
fn clone(&self) -> WindowOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WindowOptions
impl RefUnwindSafe for WindowOptions
impl Send for WindowOptions
impl Sync for WindowOptions
impl Unpin for WindowOptions
impl UnsafeUnpin for WindowOptions
impl UnwindSafe for WindowOptions
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§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.Source§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.