This event fires when the player moves their finger on the UI element using a touch-enabled device. It fires shortly before
GuiObject/TouchSwipe would, and does not fire with
GuiObject/TouchTap. This event is useful for allowing the player to manipulate the position of UI elements on the screen.
This event fires with a table of
DataType/Vector2 that describe the relative screen positions of the fingers involved in the gesture. In addition, it fires several times with multiple
Enum/UserInputStates: Begin after a brief delay, Change when the player moves their finger during the gesture and finally once more with End.
This event cannot be simulated in Studio using the emulator and a mouse; you must have a real touch enabled device to fire this event.
Below is an animation of TouchPan firing on the black semitransparent
Frame that covers the screen. The event is being used to manipulate the position of the pink inner
Frame. The code for this can be found in the code samples.
A Lua array of
Indicates how far the pan gesture has gone from its starting point
Indicates how quickly the gesture is being performed in each dimension
Panning UI Element
This code sample is meant to be placed in a
LocalScript within an inner
Frame that is inside an outer
Frame, or other
GuiObject. It allows the player to manipulate the position of the inner frame by moving their finger on the outer frame.