支付宝小程序上怎么实现手指左/右滑动 等 事件呢 #11
Answered
by
cptbtptpbcptdtptp
ChenYuZhu505812971
asked this question in
Mini Program(小程序)
-
Is your feature request related to a problem? Please describe. Describe the solution you'd like Describe alternatives you've considered Additional context |
Beta Was this translation helpful? Give feedback.
Answered by
cptbtptpbcptdtptp
Mar 27, 2024
Replies: 2 comments
-
可参考示例代码: class TouchControl extends Script {
onUpdate() {
const pointers = engine.inputManager.pointers;
if(pointers && pointers.length > 0) {
// 触控点在本帧的位置移动 pointers[0].deltaPosition
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cptbtptpbcptdtptp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
deltaPosition
来监听本帧或者这几帧的移动。可参考示例代码: