Struct gooey::Recorder [−][src]
pub struct Recorder<'a> { /* fields omitted */ }
Expand description
An easy-to-use,offscreen animation recorder.
Implementations
Renders the current state of the application and displays it for duration
.
Errors
Returns any error that occurs while rendering.
Simulates event
in the application.
Extends the last frame to display for an additional duration
.
Panics
Panics if no frames have been rendered.
pub async fn move_cursor_to(
&mut self,
location: impl Into<Point<f32, Scaled>>,
duration: Duration
) -> Result<(), HeadlessError>
pub async fn move_cursor_to(
&mut self,
location: impl Into<Point<f32, Scaled>>,
duration: Duration
) -> Result<(), HeadlessError>
Moves the cursor from the current location (or -16,-16 if no current
location) to location
. The animation is performed over duration
using the recorder’s framerate.
Errors
Returns any error that occurs while rendering.
Simulates a left click at the current cursor location.
Errors
Returns any error that occurs while rendering.
pub async fn press_key(
&mut self,
key: VirtualKeyCode,
modifiers: impl Into<Option<ModifiersState>>
) -> Result<(), HeadlessError>
pub async fn press_key(
&mut self,
key: VirtualKeyCode,
modifiers: impl Into<Option<ModifiersState>>
) -> Result<(), HeadlessError>
Saves the current frames to path
as an animated png.
Errors
Can error from io or png encoding errors.
Methods from Deref<Target = Headless<Rasterizer<Kludgine>>>
Process an event. Only supported with a rasterizer frontend.
Sets the location of the cursor to position
. Does not render any frames.
Simulates a left click at the current cursor location.
pub async fn screenshot(
&self,
size: Size<u32, Pixels>,
theme: SystemTheme,
cursor: Option<Point<f32, Scaled>>
) -> Result<DynamicImage, HeadlessError>
pub async fn screenshot(
&self,
size: Size<u32, Pixels>,
theme: SystemTheme,
cursor: Option<Point<f32, Scaled>>
) -> Result<DynamicImage, HeadlessError>
pub fn begin_recording(
&mut self,
size: Size<u32, Pixels>,
theme: SystemTheme,
render_cursor: bool,
fps: u16
) -> Recorder<'_>
pub fn begin_recording(
&mut self,
size: Size<u32, Pixels>,
theme: SystemTheme,
render_cursor: bool,
fps: u16
) -> Recorder<'_>
Begins a recording session that generates an animation.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Recorder<'a>
impl<'a> !UnwindSafe for Recorder<'a>
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more