pub struct DisplayConfig {Show 14 fields
pub title: String,
pub fullscreen: Option<MonitorIdent>,
pub dimensions: Option<(u32, u32)>,
pub min_dimensions: Option<(u32, u32)>,
pub max_dimensions: Option<(u32, u32)>,
pub visibility: bool,
pub icon: Option<PathBuf>,
pub always_on_top: bool,
pub decorations: bool,
pub maximized: bool,
pub multitouch: bool,
pub resizable: bool,
pub transparent: bool,
pub loaded_icon: Option<Icon>,
}Expand description
Configuration for a window display.
Fields§
§title: StringName of the application window.
fullscreen: Option<MonitorIdent>Enables fullscreen mode on specific monitor when set.
Defaults to None, which means fullscreen is off.
dimensions: Option<(u32, u32)>Current window dimensions, measured in pixels (px).
min_dimensions: Option<(u32, u32)>Minimum window dimensions, measured in pixels (px).
max_dimensions: Option<(u32, u32)>Maximum window dimensions, measured in pixels (px).
visibility: boolWhether the window should be immediately visible upon creation.
icon: Option<PathBuf>A path to the icon used for the window.
If loaded_icon is present, this will be ignored.
always_on_top: boolWhether the window should always be on top of other windows.
decorations: boolWhether the window should have borders and bars.
maximized: boolWhether the window should be maximized upon creation.
multitouch: boolEnable multitouch on iOS.
resizable: boolWhether the window is resizable or not.
transparent: boolWhether the the window should be transparent. If this is true, writing colors with alpha values different than 1.0 will produce a transparent window.
loaded_icon: Option<Icon>A programmatically loaded window icon; not present in serialization.
Takes precedence over icon.
§Examples
use amethyst_window::{DisplayConfig, Icon};
// First, create your `DisplayConfig` as usual
let mut config = DisplayConfig::default(); // or load from file
// Create the icon data
let mut icon = Vec::new();
for _ in 0..(128 * 128) {
icon.extend(vec![255, 0, 0, 255]);
}
// Set the `loaded_icon` field of the config
// It will now be used as the window icon
config.loaded_icon = Some(Icon::from_rgba(icon, 128, 128).unwrap());
// Now, feed this into the `GameDataBuilder` using
// `.with_bundle(WindowBundle::from_config(config))`Implementations§
Source§impl DisplayConfig
impl DisplayConfig
Sourcepub fn into_window_builder(
self,
monitors: &impl MonitorsAccess,
) -> WindowBuilder
pub fn into_window_builder( self, monitors: &impl MonitorsAccess, ) -> WindowBuilder
Creates a winit::WindowBuilder using the values set in the DisplayConfig.
The MonitorsAccess is needed to configure a fullscreen window.
Trait Implementations§
Source§impl Clone for DisplayConfig
impl Clone for DisplayConfig
Source§fn clone(&self) -> DisplayConfig
fn clone(&self) -> DisplayConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DisplayConfig
impl Debug for DisplayConfig
Source§impl Default for DisplayConfig
impl Default for DisplayConfig
Source§impl<'de> Deserialize<'de> for DisplayConfig
impl<'de> Deserialize<'de> for DisplayConfig
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>,
Source§impl PartialEq for DisplayConfig
impl PartialEq for DisplayConfig
Source§impl Serialize for DisplayConfig
impl Serialize for DisplayConfig
impl Eq for DisplayConfig
impl StructuralPartialEq for DisplayConfig
Auto Trait Implementations§
impl Freeze for DisplayConfig
impl RefUnwindSafe for DisplayConfig
impl Send for DisplayConfig
impl Sync for DisplayConfig
impl Unpin for DisplayConfig
impl UnwindSafe for DisplayConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize,
impl<T> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize,
Source§fn load<P>(path: P) -> Result<T, ConfigError>
fn load<P>(path: P) -> Result<T, ConfigError>
Source§fn load_bytes(bytes: &[u8]) -> Result<T, ConfigError>
fn load_bytes(bytes: &[u8]) -> Result<T, ConfigError>
Source§fn write<P>(&self, path: P) -> Result<(), ConfigError>
fn write<P>(&self, path: P) -> Result<(), ConfigError>
Source§fn load_no_fallback<P>(path: P) -> Result<Self, ConfigError>
fn load_no_fallback<P>(path: P) -> Result<Self, ConfigError>
load insteadSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
Source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
try_default and panics on an error case.