Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 4:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How do I get an object to follow the mouse round the screen?
PostPosted: August 8th, 2006, 9:40 am 
Offline

Joined: November 3rd, 2005, 10:55 am
Posts: 8
I wonder if anyone out there can help me?
How do I get an object to follow the mouse round the screen?


Top
 Profile  
 
 Post subject:
PostPosted: August 8th, 2006, 11:07 am 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Hi Dee,

Try this,

Set in page properties on "mouse move" action:
Code:
var mousePos = GetMousePosition()
var mouseX = mousePos.x
var mouseY = mousePos.y
Object.SetPosition(mouseX,mouseY)


You must replace object by the name of the object to follow.

Hope this helps

cheers

Ronnie


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 8th, 2006, 2:01 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
Scripting is not necessary - you can just use the Move Object To Cursor action from a Mouse Move trigger. You can put the action in an If statement with a flag variable to turn on and off the following.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 9th, 2006, 3:46 am 
Offline

Joined: October 26th, 2004, 1:26 pm
Posts: 262
Hi Dee,

To expand on the already good replies here, if you are not sure how to "stop" the object from following the mouse cursor around the screen (if you set up a loop action), then look at the very simple non-script IMP example. If this is not what you want, then specify exactly what you want to happen. :)


You do not have the required permissions to view the files attached to this post.

_________________
Cheers,
Steve


Top
 Profile  
 
 Post subject:
PostPosted: August 9th, 2006, 2:05 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
If you do use the scripting, you may wish to put in a delay, that way the object does not automatically "attach" itself to the cursor.

Code:
var mousePos = GetMousePosition()
var mouseX = mousePos.x
var mouseY = mousePos.y
wait(.12)
v1.SetPosition(mouseX,mouseY)

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 40 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group