|
| 27 Jan 2012 12:11 PM |
| I am trying to make a frame gui appear in the mouse so that when you move the mouse, it moves with it. Is this possible without using a tool? If it is impossible is there another simple way to do it? |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 12:34 PM |
I'm pretty sure that there's a function for GUI objects to find out if the mouse hovers over.
MouseHover
or
MouseHovered
Not sure... Also, I could be wrong. |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 12:54 PM |
GUI.MouseButton1Click:connect(function(Mouse) --do stuff with 'Mouse' end) |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 01:07 PM |
| So I would put the gui in the mouse? like gui.Parent = Mouse. Is that how It would work? |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 01:08 PM |
| Oh, I think I know what you want. Gimme one sec. |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 01:15 PM |
This will most likely have an issue, lemme know what it is.
GUI = script.Parent --Place the script inside of the GUI you want moved
on = false GUI.MouseButton1Click:connect(function(Mouse) if not on then x,y = Mouse.X,Mouse.Y rangeX,rangeY = x-GUI.AbsolutePosition.x,y-GUI.AbsolutePosition.y on = true Mouse.Moved:connect(function() GUI.Position = UDim2.new(0,Mouse.X-rangeX, 0,Mouse.Y-rangeY) end) else on = false GUI.Position = UDim2.new(0,Mouse.X-rangeX, 0,Mouse.Y-rangeY) end end)
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 08:26 PM |
| So I could, do like a right click to activate the frame to move with the mouse? |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 08:35 PM |
| That would be left click, change 'MouseButton1Down' to 'MouseButton2Down' for you to be able to right click. |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 08:37 PM |
| Well, yes, thats what I meant, but ok... Thank You. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2012 03:29 PM |
| Why does everyone use MouseButton1Down, it's MouseButton1Click. Makes more sense, for clicking purposes at least. |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
|
| 31 Jan 2012 03:35 PM |
| Herpaderp? If you want an function to be fired onGuiClicked, then why wouldn't you use MouseButton1Click instead of MouseButton1Down? |
|
|
| Report Abuse |
|
|
agent767
|
  |
| Joined: 03 Nov 2008 |
| Total Posts: 4181 |
|
|
| 31 Jan 2012 04:12 PM |
@epicfail because there is a MouseButton1Up-event |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2012 04:48 PM |
| Yes, I know the events for a GUI. But I'm just trying to say, why wouldn't people use MouseButton1Click if they want the function to fire onClicked. |
|
|
| Report Abuse |
|
|