Skip to content

Commit

Permalink
Make TouchInput and ForceTouch serializable (bevyengine#6191)
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonmx authored and ItsDoot committed Feb 1, 2023
1 parent f58803d commit 0cbebaf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_input/src/touch.rs
Original file line number Diff line number Diff line change
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 0cbebaf

Please sign in to comment.