PluginMouse

显示已弃用

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

无法创建

插件鼠标对象提供 Plugins 对鼠标的访问。它与 Mouse 对象类似,可以使用插件 Plugin:GetMouse() 方法获得。

注意插件鼠标只能在插件被激活使用 Plugin:Activate()

除了 Mouse 对象的函数外,插件鼠标包括 PluginMouse.DragEnter 函数,该函数跟踪选择中的项目,当鼠标拖动时。

了解有关使用鼠标对象的更多信息,请参阅Mouse页面。

代码示例

The code below demonstrates how the PluginMouse object can be obtained and used in a plugin. To use this code, paste it into a Script save that script to the local Plugins Folder using right click, save to file. The plugins folder can be found in the Plugins tab in the Roblox Studio toolbar.

PluginMouse Get

plugin:Activate(false) -- gain non exclusive access to the mouse
local mouse = plugin:GetMouse()
local function button1Down()
print("Left mouse click")
end
mouse.Button1Down:Connect(button1Down)

概要

属性

继承自Mouse属性

活动

继承自Mouse活动

属性

方法

活动

DragEnter

插件安全性

拖动鼠标时选择实例时发射。

参数

instances: Instances