Skip to content

Commit 7673db7

Browse files
committed
Make TouchInput and ForceTouch serializable (#6191)
Closes #6021
1 parent 1ca1c8c commit 7673db7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/bevy_input/src/touch.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use bevy_utils::HashMap;
2727
/// This event is the translated version of the `WindowEvent::Touch` from the `winit` crate.
2828
/// It is available to the end user and can be used for game logic.
2929
#[derive(Debug, Clone, Copy, PartialEq)]
30+
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
3031
pub struct TouchInput {
3132
/// The phase of the touch input.
3233
pub phase: TouchPhase,
@@ -43,6 +44,7 @@ pub struct TouchInput {
4344

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

0 commit comments

Comments
 (0)