Struct tetra::ContextBuilder
source · pub struct ContextBuilder<'a> { /* private fields */ }
Expand description
Creates a new Context
based on the provided options.
Implementations§
source§impl<'a> ContextBuilder<'a>
impl<'a> ContextBuilder<'a>
sourcepub fn new() -> ContextBuilder<'a>
pub fn new() -> ContextBuilder<'a>
Creates a new ContextBuilder, with the default settings.
sourcepub fn title(self, title: &'a str) -> ContextBuilder<'a>
pub fn title(self, title: &'a str) -> ContextBuilder<'a>
Sets the title of the window.
sourcepub fn size(self, width: i32, height: i32) -> ContextBuilder<'a>
pub fn size(self, width: i32, height: i32) -> ContextBuilder<'a>
Sets the internal size of the screen.
sourcepub fn scale(self, scale: i32) -> ContextBuilder<'a>
pub fn scale(self, scale: i32) -> ContextBuilder<'a>
Sets the initial scale of the window, relative to the internal screen size.
sourcepub fn vsync(self, vsync: bool) -> ContextBuilder<'a>
pub fn vsync(self, vsync: bool) -> ContextBuilder<'a>
Enables or disables vsync.
sourcepub fn resizable(self, resizable: bool) -> ContextBuilder<'a>
pub fn resizable(self, resizable: bool) -> ContextBuilder<'a>
Sets whether or not the window should be resizable.
sourcepub fn tick_rate(self, tick_rate: f64) -> ContextBuilder<'a>
pub fn tick_rate(self, tick_rate: f64) -> ContextBuilder<'a>
Sets the game’s update tick rate.
sourcepub fn quit_on_escape(self, quit_on_escape: bool) -> ContextBuilder<'a>
pub fn quit_on_escape(self, quit_on_escape: bool) -> ContextBuilder<'a>
Sets whether or not the game should close when the Escape key is pressed.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ContextBuilder<'a>
impl<'a> Send for ContextBuilder<'a>
impl<'a> Sync for ContextBuilder<'a>
impl<'a> Unpin for ContextBuilder<'a>
impl<'a> UnwindSafe for ContextBuilder<'a>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SetParameter for T
impl<T> SetParameter for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.