Module path
Path objects for complex swiping
Class Path
| Path:__init (locations) | Create a Path object |
| Path:begin_swipe (fingerID, speed) | Begin swiping the path by placing a finger on the starting position |
| Path:step (fingerID, on_move) | Move to the next position in the swipe |
| Path:swipe (options) | Swipe the path from beginning to end |
| Path.arc (radius, start_angle, end_angle, center) | Arc path with an angle and radius from a center pixel |
| Path.linear (start_pixel, end_pixel) | Linear path between two pixels |
Class RelativePath
| RelativePath:__init (locations) | Create a RelativePath object |
Class Path
List of absolute positions that define a path on the screen
- Path:__init (locations)
-
Create a Path object
Parameters:
- locations iterable of x, y locations that define a path
See also:
Usage:
path = Path{{x=0, y=0}, {x=10, y=10}} path = Path{Pixel(0, 0), Pixel(10, 10)} - Path:begin_swipe (fingerID, speed)
-
Begin swiping the path by placing a finger on the starting position
Parameters:
- fingerID (optional) ID of finger to use for swipe
- speed (optional) swipe speed (number of points to skip at each move)
- Path:step (fingerID, on_move)
-
Move to the next position in the swipe
Parameters:
- fingerID (optional) ID of finger to use for swipe
- on_move (optional) function to run at each movement
Returns:
-
boolean
whether the path will continue swiping or not
- Path:swipe (options)
-
Swipe the path from beginning to end
Parameters:
- options table options for swipe (fingerID, speed, on_move)
Returns:
-
screen
screen for method chaining
See also:
- Path.arc (radius, start_angle, end_angle, center)
-
Arc path with an angle and radius from a center pixel
Parameters:
- radius number distance from center_pixel in pixels to draw arc
- start_angle number angle where the arc begins (in degrees)
- end_angle number (optional) angle where the arc ends (in degrees)
- center pixel.Pixel (optional) center pixel of arc
Returns:
-
Path or RelativePath
desired path (RelativePath if center argument omitted)
- Path.linear (start_pixel, end_pixel)
-
Linear path between two pixels
Parameters:
- start_pixel pixel.Pixel beginning of path
- end_pixel pixel.Pixel (optional) end of path
Returns:
-
Path or RelativePath
desired path (RelativePath if end_pixel argument omitted)
Class RelativePath
List of relative positions that define a path on the screen