Adevix
(Adevix)
September 11, 2020, 3:39pm
1
Hello dear developers, so recently I have been wondering if I could detect mouse’s icon change.
So, whenever your mouse is focused on an GUI object, it changes to dark color, but when it’s not focused, it goes back to white color.
So the main question is: is it possible to detect these changes?
DR1FTTR
(everett)
September 11, 2020, 3:49pm
2
Go to a local script. Get Player mouse = player:GetMouse() then get the button or what ever button.MouseHoverOver:Connect(function()) I think it is then mouse.Icon = “The Mouse ICon you want”
By assumption, the Icon of the PlayerMouse (returned from Player::GetMouse) is changed to show the dark color.
Since PlayerMouse is an Instance, it has the GetPropertyChangedSignal method - you can use this specifically for the Icon property:
PlayerMouse:GetPropertyChangedSignal("Icon"):Connect(function()
--// Code
end)
Alternatively, you can use the Changed event and see if the property changed was Icon however I don’t recommend it.
Adevix
(Adevix)
September 11, 2020, 5:22pm
4
hm, when i print mouse.Icon, in output i see - “”, i want detect white or dark, and nothing other
1 Like