- Home /
How to drag mouse on circular arrow
Hi Guys,
I want to achieve a functionality describe below:
I want to drag mouse on arrow in curve form (see attached image)
I want to know length/position (0-1 meter) of mouse on the arrow while dragging
Mouse should not goes out side the arrow while dragging, if possible.
Please help me to achieve this functionality, how can I do this?
Thanks in advanced :)
I didn't quite understand what you are trying to do?
1). I want to drag mouse from right(0 meter) to left(1 meter) within the arrow by following dotted line 2). Now, suppose length of dotted line is 1 meter and I have dragged mouse from right most corner of dotted line(0 meter) to half of length of dotted line, then position of mouse will be 0.5 meter away from right corner of the dotted line, I need this value i.e 0.5,
Are you getting me what I need, if not, then I can explain you more.
Oh, are you trying to calculate the distance within an arrow path from your start point which is 0 meter in that manner.
what i don't understand in your statement "$$anonymous$$ouse should not goes out side the arrow while dragging, if possible." Since you are moving the mouse isn't it really up to you?
Answer by baci · Dec 26, 2013 at 11:37 AM
If I understood correctly, you want to drag something visually along a given line? I suggest taking the mouse coordinates input and approximate the closest value on the curve, to display the mouse cursor there. For example, if the curve would be a straight horizontal line, just display the cursor on the x value of the mouse position and the y value of the line.
Exaclty,this logic is also in my $$anonymous$$d but how can I calculate mouse position along with dotted curve, that is the problem. Is There any formula to calculate that?
Also keep in $$anonymous$$d, given angle of arrow is not original, it may vary according to our need :)
I am looking for better way to do this.
Your answer
Follow this Question
Related Questions
Dragging a GameObject with mouse 1 Answer
Prevent object from jumping to center point when dragging starts 1 Answer
Drag and Drop causes oblject to disapear 0 Answers
Following instruction for drag and drop 3d object unity but not working 1 Answer
Making scrollview single-direction while allow dragging parent in other diration 2 Answers