pub struct Config {
pub width: u32,
pub height: u32,
pub no_loop: bool,
pub frames: Option<u32>,
pub cursor_visible: bool,
pub frames_to_save: u32,
pub window_title: String,
}Expand description
Configuration for the application window and rendering behavior
Fields§
§width: u32Width of the window in pixels
height: u32Height of the window in pixels
no_loop: boolIf true, the application will only render one frame
frames: Option<u32>Optional limit on the number of frames to render, if None, the application will render indefinitely.
cursor_visible: boolControls whether the cursor is visible in the window
frames_to_save: u32Number of frames to save as PNG files
window_title: StringTitle of the application window
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(
width: u32,
height: u32,
no_loop: bool,
cursor_visible: bool,
frames_to_save: u32,
) -> Self
pub fn new( width: u32, height: u32, no_loop: bool, cursor_visible: bool, frames_to_save: u32, ) -> Self
Creates a new configuration with the specified parameters
§Arguments
width- Window width in pixelsheight- Window height in pixelsno_loop- If true, renders only one framecursor_visible- Controls cursor visibilityframes_to_save- Number of frames to save as PNG fileswindow_title- Title of the application window
Sourcepub fn with_dims(width: u32, height: u32) -> Self
pub fn with_dims(width: u32, height: u32) -> Self
Creates a new configuration with just width and height Other parameters are set to their defaults
Sourcepub fn set_frames_to_save(self, frames_to_save: u32) -> Self
pub fn set_frames_to_save(self, frames_to_save: u32) -> Self
Sets the number of frames to save and returns updated config
Sourcepub fn set_cursor_visibility(self, cursor_visible: bool) -> Self
pub fn set_cursor_visibility(self, cursor_visible: bool) -> Self
Sets cursor visibility and returns updated config
Sourcepub fn set_frames(self, frames: u32) -> Self
pub fn set_frames(self, frames: u32) -> Self
Sets the frame limit and returns updated config
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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.Source§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.Source§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.Source§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.