> For the complete documentation index, see [llms.txt](https://niam.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://niam.gitbook.io/documentation/game-creator-2/tactile/control-type/swipe-pad.md).

# Swipe Pad

## Description

A control type that performs actions or responds based on the swipe direction, typically involving the rapid movement of one or more fingers across the touchable area.

## Common

<figure><img src="https://348920791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeQ7CIxHuad77enwt80mG%2Fuploads%2F7bhM0uom9T8SgsBAvzjM%2F%7BC9CD0A4D-04E2-4DCB-9EB7-0C6B54C1F68B%7D.png?alt=media&amp;token=f9f97dfa-f32b-4caa-9176-ae2e3fd2bdeb" alt=""><figcaption></figcaption></figure>

* `Continuous` : Whether swipe are performed continuously or triggered only once per swipe, allowing uninterrupted swiping without releasing.

{% hint style="info" %}
When `Continuous` is true, swipe validation happens when you stop moving your finger, without needing to lift it.
{% endhint %}

## Directions

<figure><img src="https://348920791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeQ7CIxHuad77enwt80mG%2Fuploads%2FjFwHWWAe8QUqerCMjcky%2F%7BFCC82560-FA1A-433A-9C5C-1613CBDFB98A%7D.png?alt=media&amp;token=cae45b75-17b3-4ef5-83ce-d88ca1dae5ad" alt=""><figcaption></figcaption></figure>

* `Input Simulate` : The Button control path for simulating input on swipe.
* `Required Fingers` : The number of fingers required to perform a given swipe direction.
* `Swipe ID` : A unique identifier for distinguishing different swipes.
* `Angle` : Defines the direction of the swipe based on angle.
* `Arc` : Specifies the angular range around the swipe angle.

## Validation

The touch points will be sampled and recorded upon dragging. When release, an imaginary straight line is drawn between the first and last sample points. and before confirming a swipe, it must satisfy the following evaluation criteria:

<figure><img src="https://348920791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeQ7CIxHuad77enwt80mG%2Fuploads%2Fe7GbDhzVLy8KfG4jQSN5%2F%7B4766981E-6D34-46D4-8EA9-E9D0E937968E%7D.png?alt=media&amp;token=5e54da49-3976-471b-b06b-b7509633e643" alt=""><figcaption></figcaption></figure>

* `Min Swipe Distance`: The minimum distance of the straight line to be consider as a swipe.
* `Max Swipe Duration`: The maximum allowed time (in ms) to complete the swipe gesture.
* `Min Sample Distance`: The minimum required distance between consecutive sampled points.
* `Max Sample Deviation`: The maximum allowable distance of any sampled point from the straight line.
