Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to know if mouse position is in a frame?

script.Parent.Parent.Parent.cwc.MouseLeave:connect(function()
script.Parent.Parent.Parent.cwc.FadeScripts.fadeout.Disabled = true
wait()
script.Parent.Parent.Parent.cwc.FadeScripts.fadeout.Disabled = false
script.Disabled = true
end)

I want to know if the mouse position is not pointing at the frame (frame is in the script above (mouseleave function)

i tried using mouseleave, but that only functions if the mouse is already pointing at the frame. i want to know how i could tell if the mouse is not pointing at the frame?

NOTE: THE 'FRAME' IS A TEXTBUTTON

1 answer

✓ Accepted answer

It's not that difficult, if you think logically.

Get the mouse absolute position X and Y. Get the frame absolute position X and Y. Get the frames absolute size X and Y.

Check if the mouse position is anywhere between frame absolute position X and Y, and frame position + frame size X and Y.

I don't feel like writing code for this, but if you really need it, poke me back. Hope this helps you.

1 comment

0

I needed the absolute position, yes! Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.