nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Mar 2010 10:39 AM |
| Is there a possible way to detect the mouse's position using offset? |
|
|
| Report Abuse |
|
|
GoldenUrg
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 6428 |
|
|
| 28 Mar 2010 10:59 AM |
The mouse position in 3D or in a GUI?
For 3D you need the Mouse object from a tool or hopperbin.
For a GUI, use the MoveMoved event.
|
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Mar 2010 11:50 AM |
So GUI,
script.Parent.MouseMoved:connect(funcion(o) print(o.Position) end)
?? or
script.Parent.MouseMoved:connect(funcion(o) print(script.Parent.Parent.Parent.Parent.Mouse.Position) end)
?? |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2010 11:52 AM |
or...
TagMouseHere.Move:connect(YouzFunctionNameGoesHere) |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
| |
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Mar 2010 11:56 AM |
TagMouseHere.Move:connect(funtion() print(TagMouseHere.Postion) end) |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Mar 2010 11:59 AM |
| Hmm.... then how would you print offset using a hopperbin? |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
| |
|
GoldenUrg
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 6428 |
|
|
| 28 Mar 2010 05:43 PM |
Open Roblox Studio. Help -> Object Browser Select Frame in the left pane Select MouseMoved in the upper right frame Notice that: event MouseMoved(int x, int y)
Thus, MyFrame.MouseMoved:connect( function( x, y ) print( "Mouse is now at " .. x .. "," .. y ) end )
|
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 28 Mar 2010 05:46 PM |
| ...That gives it in pixels. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Mar 2010 08:44 PM |
| Thanks golden, but umm, is there a way of doing it in offset? |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Mar 2010 08:47 PM |
script.Parent.MouseMoved:connect( function( x, y ) print( "Mouse is now at " .. x.Offset .. "," .. y.Offset ) end )
|
|
|
| Report Abuse |
|
|