TouchSwipe
格式
TouchSwipe(touchMoveDir, touchCount)
- 事件
- 所属对象:UiImage
描述
在GUI对象上,使用手指滑动时,触发此事件。
其他相关
参数
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
touchMoveDir | touchMoveDir | 滑动方向 | |
touchCount | Input.touchCount | 触摸点数量 |
实例
先在客户端最先加载下添加客户端脚本,开始运行后,用手指滑动,观察是否触发此事件。
wait(1)
local uipanel = RWObject:New("UiPanel") --创建uipanel
local uiimage = RWObject:New("UiImage") --创建UiImage
uiimage.Parent = uipanel --将创建的UiImage的父级设置成玩家界面
local person = Players:GetLocalPlayer() --获取玩家
uipanel.Parent = person.GameUI --将uipanel的父级设置成玩家界面
uiimage.TouchSwipe:Connect(function(touchMoveDir,touchCount)
uiimage.ImageColor = Vector3(255,0,0)
print("滑动方向:"..tostring(touchMoveDir).." ".."触摸点数量:"..touchCount)
end)
文档更新时间: 2020-09-16 16:53 作者:宋澍川