developa Posted July 31, 2017 Share Posted July 31, 2017 (edited) Hello, how do I move an image to a point using the mouse cursor? That means that we click on the image and move it to the specified point. Help! Presentation film: (Second in the film: 0:23) https://www.youtube.com/watch?v=F-eI5YCsWnM&index=6&list=PLp_5iWqN0r1irWsL9saGbRRiOoVXlLPuH Edited July 31, 2017 by developa Link to comment
myonlake Posted July 31, 2017 Share Posted July 31, 2017 Don't bump your forum posts while they're still 7 hours old. You can use onClientClick to check if a mouse button is pressed down, which allows you to then move around an item on the screen using getCursorPosition in conjunction with onClientRender. To stop moving, you can again use the same onClientClick event to determine when the mouse button is up so you can stop rendering the movement. Link to comment
coNolel Posted July 31, 2017 Share Posted July 31, 2017 (edited) 1 hour ago, myonlake said: Don't bump your forum posts while they're still 7 hours old. You can use onClientClick to check if a mouse button is pressed down, which allows you to then move around an item on the screen using getCursorPosition in conjunction with onClientRender. To stop moving, you can again use the same onClientClick event to determine when the mouse button is up so you can stop rendering the movement. getCursorPosition* screenSizeX because getCursorPosition returns a value from 0 to 1 Edited July 31, 2017 by coNolel Link to comment
NeXuS™ Posted August 1, 2017 Share Posted August 1, 2017 13 hours ago, coNolel said: getCursorPosition* screenSizeX because getCursorPosition returns a value from 0 to 1 You still have to use getCursorPosition whether it returns a value from 0 to 1. Btw, you can easily recreate the function to have it do the multiplication automatically. 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now