generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Mouse

Previous Thread :: Next Thread 
nate890 is not online. 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 is not online. 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 is not online. 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
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
28 Mar 2010 11:52 AM
or...

TagMouseHere.Move:connect(YouzFunctionNameGoesHere)
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
28 Mar 2010 11:55 AM
What?
Report Abuse
nate890 is not online. 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 is not online. 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 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
28 Mar 2010 01:15 PM
Bump
Report Abuse
GoldenUrg is not online. 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 is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
28 Mar 2010 05:46 PM
...That gives it in pixels.
Report Abuse
nate890 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image