TouchPan
格式
TouchPan(Touch.position, pandistance, panspeed, touchState)
- 事件
- 所属对象:UiPanel
描述
鼠标左键在GUI对象上按下时,触发此事件。
其他相关
参数
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
Touch.position | Vector3 | 触摸点坐标 | |
pandistance | Vector3 | 移动偏移量 | |
panspeed | Vector3 | 偏移速度(像素/秒) | |
touchState | Enum.UserInputState | 输入类型的状态 |
实例
先在客户端最先加载下添加客户端脚本,开始运行后,用手指按gui对象并移动时。
wait(1)
local uipanel = RWObject:New("UiPanel") --创建uipanel
local person = Players:GetLocalPlayer() --获取玩家
uipanel.Parent = person.GameUI --将uipanel的父级设置成玩家界面
uipanel.TouchPan:Connect(function(pos,dir,speed,state)
print("在gui对象上移动手指")
print(tostring(pos))
print(tostring(dir))
print(tostring(speed))
print(tostring(state))
end)
文档更新时间: 2020-09-16 17:01 作者:宋澍川