模拟手指在屏幕上移动 (:move_to)

声明

触摸事件 = 触摸事件:move_to(横坐标, 纵坐标)

参数及返回值

  • 横坐标, 纵坐标
    • 整数型,需要移动至的点于当前旋转坐标系的坐标
  • 触摸事件
    • 触摸事件对象,通过调用 touch.down 函数可以获得一个用于操控当前触摸的事件对象

示例

-- 模拟一个手指于点 100, 100 的位置接触屏幕,然后匀速滑动到点 200, 200 的位置,然后松开
touch.down(100, 100):move_to(200, 200):up():perform()
powered by GitbookFile Modify: 2021-03-27 23:14:19

results matching ""

    No results matching ""