SwipePoint()
Represents a point in a swipe path. Used with Screen:swipe() and Screen:multiSwipe() to define where the finger moves, how fast, and how long it pauses.
Constructor
SwipePoint(x, y, holdDuration, swipeDuration);
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| x | number | required | The x coordinate in screen pixels |
| y | number | required | The y coordinate in screen pixels |
| holdDuration | number | 50 | How long in milliseconds to hold at this position |
| swipeDuration | number | 2000 | Duration in milliseconds (meaning depends on position in the swipe list) |
Parameter meaning depends on position
The swipeDuration and holdDuration parameters have different meanings depending on whether the SwipePoint is the first point or a subsequent point in the swipe list:
As the first point:
swipeDuration— Initial delay before the finger touches down (sleep)holdDuration— Hold at the start position before moving
As a subsequent point:
swipeDuration— Duration to travel from the previous point to this pointholdDuration— Hold at this point after arriving
Example
-- Touch down at (500, 1000) after 1 second delay,
-- hold 50ms, then move to (500, 400) over 2 seconds
Screen:swipe({
SwipePoint(500, 1000, 50, 1000),
SwipePoint(500, 400, 50, 2000),
})
Notes
- If
swipeDurationis0, it is treated as1ms (essentially instant) - If
holdDurationis0, there is no hold at that point