Skip to content

Commit

Permalink
Make TouchInput and ForceTouch serializable (#6191)
Browse files Browse the repository at this point in the history
Closes #6021
  • Loading branch information
emersonmx committed Oct 10, 2022
1 parent 1ca1c8c commit 7673db7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_input/src/touch.rs
Expand Up @@ -27,6 +27,7 @@ use bevy_utils::HashMap;
/// This event is the translated version of the `WindowEvent::Touch` from the `winit` crate.
/// It is available to the end user and can be used for game logic.
#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
pub struct TouchInput {
/// The phase of the touch input.
pub phase: TouchPhase,
Expand All @@ -43,6 +44,7 @@ pub struct TouchInput {

/// A force description of a [`Touch`](crate::touch::Touch) input.
#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
pub enum ForceTouch {
/// On iOS, the force is calibrated so that the same number corresponds to
/// roughly the same amount of pressure on the screen regardless of the
Expand Down

0 comments on commit 7673db7

Please sign in to comment.