I am implementing a game in which there are touch events and I have implemented it but not working. My code for touch listener is here:
Public Boolean On-Touch (see V, Motion Event Event) {int action = event.getAction (); If (verb == MotionEvent.ACTION_DOWN) {if (event.getX ()> gt; rx & amp; amp; amp; amp; event.getX () (ry-20) & amp; event.getY () & lt; ry) {touch = true; } Back true; } And if (action == motion avent.action_ MOVE and touch) {if (event.getX ()> gt; 0 & amp; amp; amp; event.getX () <220) {rx = Event.getX (); RI: event.getY (); } Back true; } return false; } Here r is the object of the rectangle and the coordinates of X and Y are rectangular.
I am writing a touch listener in a superficial view, so I have written the listener in the activity, hence the problem Resolved
Comments
Post a Comment