PluginMouse 對象提供 Plugins 對滑鼠標的存取。它與 Mouse 對象相同,可以使用 plugin Plugin:GetMouse() 方式獲得。
注意,PluginMouse 只能在使用 Plugin:Activate() 啟用時使用。
在 Mouse 對物件的基礎上,PluginMouse 包括 PluginMouse.DragEnter 功能,負責跟蹤選擇項目,而且在滑鼠拖曳時保持。
有關使用滑鼠對象的更多資訊,請參閱 Mouse 頁面。
範例程式碼
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)
概要
屬性
屬性 繼承自 MouseThe CFrame of the mouse's position in 3D space.
The content ID of the image used as the Mouse icon.
A CFrame positioned at the Workspace.CurrentCamera and oriented toward the mouse's 3D position.
The object in 3D space the mouse is pointing to.
Determines an object (and its descendants) to be ignored when determining Mouse.Hit and Mouse.Target.
Indicates the Enum.NormalId of the BasePart surface at which the mouse is pointing.
A Ray directed towards the mouse's world position, originating from the Workspace.CurrentCamera world position.
Describes the width of the game window in pixels.
Describes the height of the game window in pixels.
Describes the X (horizontal) component of the mouse's position on the screen.
Describes the Y (vertical) component of the mouse's screen position.
活動
滑鼠拖動時選擇實例時發射。
Fired when the left mouse button is pressed.
Fires when the left mouse button is released.
Fires when the right mouse button is pressed.
Fired when the right mouse button is released.
Fired during every heartbeat that the mouse isn't being passed to another mouse event.
Fired when the mouse is moved.
Fires when the mouse wheel is scrolled backwards.
Fires when the mouse wheel is scrolled forwards.
屬性
方法
活動
DragEnter
滑鼠拖動時選擇實例時發射。