GetMouseLocation
格式
GetMouseLocation()
- 函数
- 所属对象:UserInputService
只有客户端脚本可访问
简介
返回值
类型 | 描述 |
---|---|
Vector2 | 鼠标处于屏幕的坐标 |
实例
观察是否触发鼠标的当前屏幕位置事件。
wait(1)
local uis=GetService("UserInputService") --获取用户输入服务
coroutine.start(function()
while true do
coroutine.wait(0.1)
print(tostring(uis:GetMouseLocation())) --打印鼠标在游戏界面中的坐标
end
end)
文档更新时间: 2020-07-11 14:25 作者:王辰剑