leafwing_input_playback

Crates.ioleafwing_input_playback
lib.rsleafwing_input_playback
version0.5.0
sourcesrc
created_at2022-11-13 21:21:55.754839
updated_at2024-03-01 03:43:11.676595
descriptionInput recording and mocking functionality for the Bevy game engine.
homepagehttps://leafwing-studios.com/
repositoryhttps://github.com/leafwing-studios/leafwing_input_playback
max_upload_size
id714519
size217,486
Alice Cecile (alice-i-cecile)

documentation

README

About

An input recording and playback library for the [Bevy] game engine in Rust. Test your games and applications without breaking a sweat. Support Tool Assisted Speedruns (TAS) effortlessly. Make crazy game mechanics where your player's inputs are echoed??

This crate currently captures the following input modes:

  • keyboard
  • mouse
  • gamepad

If you need more, please feel free to file an issue or open a PR!

Getting started

If you're new to this crate, check out the input_playback example to get a good overview of how it all works in practice.

Playback-powered testing

This crate can be used to capture, save to disk, and then play back user inputs in a macro-like fashion. This serialization-based workflow is a natural (if somewhat brittle) fit for testing UI, app logic and gameplay elements of your Bevy apps.

Simply toggle on InputCapturePlugin, set a PlaybackFilePath, perform your inputs and then close the app.

Then, when evaluating tests, loop through each saved input sample, and run your app with the InputPlaybackPlugin, providing a PlaybackFilePath corresponding to the input sample you are testing. AppExit events are also captured, your tests will close down automatically when they're complete.

Commit count: 24

cargo fmt