Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / mousemovez() command almost work

Author
Message
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 23rd Mar 2009 11:33 Edited at: 23rd Mar 2009 11:36
I dont get whats wrong with this code. its suppose to move a cube (object 1) up or down once the scroller button is scrolled forward or backward, but it only moves the object either up or down depending on witch codeline you place first.



so if i write "if mousemovez() <0..." after "if mousemovez() >0" the command wont work etc. But if i delete a codeline the other codeline works well alone. I i cant write "else" or "or" beetwen the lines. Any ideas?

Hello!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Mar 2009 12:06
The mouseMoveZ (as well as the X and Y ones) will only work once a loop; they are cleared after use.
Therefore, you should store their value to a variable and use that instead. Like so:


SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 23rd Mar 2009 18:14
Great thanx! that is working perfect. But is there a way to make a limit value of how mutch to scroll the mousewheel. Let say im opening a door by scrolling the wheel, then i would like to have some kind of limit to stop the door from opening (else it will move troght the wall). Or in my case - stop the cube (object 1) from moving up or down.

Hello!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Mar 2009 18:20
Using that method, you could always do it like this, if that is what you were asking (not quite sure?):


SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 23rd Mar 2009 21:49 Edited at: 23rd Mar 2009 21:51
Thank you for your time. This is how i would like it to be:



Hello!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Mar 2009 22:29
You're welcome

You would do that like so:


James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 23rd Mar 2009 22:38
Mousemovez doesn`t produce a float value it produces an integer. The value produced is set in increments/decrements of 120 - at least on all the machines I`ve tested on so you need to divide the result by 120.


The helpfile for mousez() is innacurate if all machines produce the results in the same way.

This what your after?

Login to post a reply

Server time is: 2024-11-25 10:21:50
Your offset time is: 2024-11-25 10:21:50