จุดหนึ่งในเส้นทางการปัดแบบเรียบ จุดจะต้องเป็นจุดหรือทูเพิล (x, y) Pass a list of at least two SwipePoint values to swipe([...]) to move one finger through multiple points.
รูปแบบคำสั่ง
SwipePoint(point, speed="NORMAL", delay_before=0, random=10, humanized=False, scale="fixed", anchor="none")พารามิเตอร์สำหรับสร้างออบเจ็กต์
| ชื่อ | คำอธิบาย |
|---|---|
pointPoint | tuple[Number, Number] | Coordinate as Point or tuple (x, y). Point scale/anchor metadata is copied unless scale/anchor are provided on SwipePoint. จำเป็น · ระบุตามตำแหน่งหรือชื่อ ไม่มีค่าเริ่มต้น |
speedString | Speed preset from this point to the next point. Values: VERY_SLOW, SLOW, NORMAL, FAST, VERY_FAST. ไม่บังคับ · ระบุตามตำแหน่งหรือชื่อ ค่าเริ่มต้น: NORMAL |
delay_beforeNumber | Delay before this point/segment in milliseconds. ไม่บังคับ · ระบุตามตำแหน่งหรือชื่อ ค่าเริ่มต้น: 0 |
randomNumber | Random pixel offset radius for this point. ไม่บังคับ · ระบุตามตำแหน่งหรือชื่อ ค่าเริ่มต้น: 10 |
humanizedBoolean | Use a curved human-like path where supported. ไม่บังคับ · ระบุตามตำแหน่งหรือชื่อ ค่าเริ่มต้น: False |
scaleString | Coordinate scale mode. ไม่บังคับ · ระบุตามตำแหน่งหรือชื่อ ค่าเริ่มต้น: fixed |
anchorString | Coordinate anchor. ไม่บังคับ · ระบุตามตำแหน่งหรือชื่อ ค่าเริ่มต้น: none |
ค่าที่ส่งกลับ
SwipePointพฤติกรรม / ผลข้างเคียง
จุดหนึ่งในเส้นทางการปัดแบบเรียบ จุดจะต้องเป็นจุดหรือทูเพิล (x, y) Pass a list of at least two SwipePoint values to swipe([...]) to move one finger through multiple points.
การทำงาน
- รอให้เสร็จ: ไม่
- ความปลอดภัยเมื่อทำงานพร้อมกัน: ใช้วัตถุแยกสำหรับแต่ละโฟลว์
- การทำงานแบบขนาน: ใช่
การทำงานกับค่าทำในโฟลว์ที่เรียก โดยไม่ตั้งใจรอการจับภาพ ท่าทาง หรือข้อมูลจากผู้ใช้ สร้างคอนเทนเนอร์และบิลเดอร์ที่เปลี่ยนค่าได้แยกในแต่ละโฟลว์ การแยกนี้ไม่รับประกันการซิงโครไนซ์ออบเจ็กต์ที่แชร์
ตัวอย่าง
# สองนิ้วทำงานพร้อมกัน โดยแต่ละนิ้วเป็น path แบบแบนหนึ่งเส้น
Touch.collect()
left = swipe([
SwipePoint(Point(300, 1500), speed="FAST"),
SwipePoint(Point(300, 500))
], parallel=True)
right = swipe([
SwipePoint(Point(780, 1500), speed="FAST"),
SwipePoint(Point(780, 500))
], parallel=True)
Touch.send()
Touch.wait()ข้อผิดพลาด / ข้อจำกัด
ไม่มีข้อจำกัดเพิ่มเติมที่ระบุไว้ ให้ปฏิบัติตามพารามิเตอร์และพฤติกรรมข้างต้น
API ที่เกี่ยวข้อง
ไม่มี
ฟิลด์
| ชื่อ | คำอธิบาย |
|---|---|
pointPoint | Coordinate point in pixels. Point carries scale/anchor metadata. |
speedString | Speed preset from this point to the next point. Values: VERY_SLOW, SLOW, NORMAL, FAST, VERY_FAST. ค่าเริ่มต้น: NORMAL |
delay_beforeNumber | Delay before this point/segment in milliseconds. ค่าเริ่มต้น: 0 |
randomNumber | Random pixel offset radius for this point. ค่าเริ่มต้น: 10 |
humanizedBoolean | Use a curved human-like path where supported. ค่าเริ่มต้น: False |
scaleString | Coordinate scale mode. ค่าเริ่มต้น: fixed |
anchorString | Coordinate anchor. ค่าเริ่มต้น: none |
ตัวอย่างการสร้างออบเจ็กต์
path = [
SwipePoint(Point(500, 1500), speed="FAST"),
SwipePoint((560, 980), speed="NORMAL", humanized=True),
SwipePoint(Point(500, 500))
]
swipe(path)