TouchInfo

struct in Doozy.Engine.Touchy

Description

Structure that stores data related to a single touch instance and is sent throughout the Touchy system as a data package

Public Variables

  •  public Touch Touch – Structure describing the status of a finger touching the screen

  •  public Swipe Direction – Swipe direction

  •  public Vector2 RawDirection – The raw direction, as a Vector2, that describes this touch

  •  public Vector2 StartPosition – Touch position where this touch started (used to detect gestures)

  •  public Vector2 EndPosition – Touch position where this touch ended (used to detect gestures)

  •  public Vector2 Velocity – How fast the touch moved on both X and Y axes

  •  public float StartTime – When did the touch start (used to detect gestures)

  •  public float EndTime – When did the touch end (used to detect gestures)

  •  public float Duration – For how long did the touch happen (used to detect gestures)

  •  public bool Tap – Was this touch a tap (a light touch on a touch-sensitive screen)

  •  public bool LongTap – Was this touch a long tap (a light touch on a touch-sensitive screen, held down down for a second or two)

  •  public float Distance – Distance in the current frame (while the touch is in progress)

  •  public float LongestDistance – Distance from the start position to the end position

  •  public GameObject GameObject – Reference to the object involved in the touch event

  •  public GameObject DraggedObject – Reference to the object currently being dragged in the touch event

  •  public Vector2 CurrentTouchPosition – Touch position in the current frame

  •  public Vector2 PreviousTouchPosition – Touch position in the previous frame

  •  public float TouchDeltaTime – Amount of time that has passed since the last recorded change in Touch values

Properties

  •  public bool IsDragging – Returns TRUE if a GameObject is currently being dragged (DraggedObject != null)

  •  public Vector2 TouchVelocity – Returns the touch velocity between the current touch position and the previous touch position

Public Methods

  •  public void Update(Touch touch, GameObject gameObject = null) – Updates the struct data with the given Touch info and GameObject reference

  •  public override string ToString() – Returns a nicely formatted string for this TouchInfo