Hello,
newbie question (I think) :
I need to determine in which direction (left, right, up, down) a lable is dragged (moved) using Activity_Touch.
I was thinking of analyzing the change of the label's x,y position in Activity_Touch, something like
if lastX - x <0 then lable_was_moved_left
if lastX - x >0 then lable_was_moved_right
if lassY - y <0 then lable_was_moved_up
if lastY - y >0 then lable_was_moved_down
(maybe checked in a timer...)
Is this the best way to do it ?
But what if the label is dragged left..but a bit down, too ? So the "main"-direction is left...
I'd need some of a "trembling compensation"
Is using angles a good idea? So for example dragging left ist 0 degree, up 90 degree,left 180 degree and down 270%?
Then I'd need to calculate the angle of the dragging..how could I do that?
Heinz
newbie question (I think) :
I need to determine in which direction (left, right, up, down) a lable is dragged (moved) using Activity_Touch.
I was thinking of analyzing the change of the label's x,y position in Activity_Touch, something like
if lastX - x <0 then lable_was_moved_left
if lastX - x >0 then lable_was_moved_right
if lassY - y <0 then lable_was_moved_up
if lastY - y >0 then lable_was_moved_down
(maybe checked in a timer...)
Is this the best way to do it ?
But what if the label is dragged left..but a bit down, too ? So the "main"-direction is left...
I'd need some of a "trembling compensation"
Is using angles a good idea? So for example dragging left ist 0 degree, up 90 degree,left 180 degree and down 270%?
Then I'd need to calculate the angle of the dragging..how could I do that?
Heinz