The TouchSwipe event fires when the player performs a swipe gesture on the UI element using a touch-enabled device. It fires with the direction of the gesture (Up, Down, Left or Right) and the number of touch points involved in the gesture. Swipe gestures are often used to change tabs in mobile UIs.
Since this event only requires one finger, this event can be simulated in Studio using the emulator and a mouse. Below is an example of TouchSwipe being fired on a Frame that is
GuiObject/Active. Below, the event fires when the Frame moves and changes color slightly. The code for this can be found the code samples.
This event is part of a family of touch-related events. Other events like this one are
Guiobject/TouchLongPress. In addition,
UserInputService has a similarly named event that is not restricted to a specific UI element:
The number of touch points involved in the gesture (usually 1)
Bouncing Color Picker
This code sample will cause a
Frame (or other
GuiObject) to bounce when a swipe gesture is performed on a touch-enabled device (or Studio’s emulator). Horizontal swipes will change the hue of the
GuiObject/BackgroundColor3, while vertical swipes will change the saturation.