Jump to content
  • Advertisement
Sign in to follow this  
horrificmonster

Unity Android Touch Event

This topic is 1224 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

 

Been really wanting to get into mobile game development, thought this might be a good community to be a part of! I was wondering if someone could help explain something to me. This is in regard to an Android game developed in Java, specifically the input API.

 

I'm trying to wrap my head around the MotionEvent.ACTION_MOVE events that are passed to the OnTouch method. Everything I've read says that the ACTION_MOVE type events are consolidated into one event. So I've set up an int to save the action, and then another int to save the index. But I'm a little confused here, if move events are consolidated and there are multiple events what index am I getting back when I mask the action and shift the bits to get an index?

 

Also, is the underlying array persistent between calls to OnTouch? Is it possible to have an ACTION_POINTER_DOWN and ACTION_MOVE within the same array? Or are you getting a fresh array for each motion event?

 

Any help would be much appreciated!

 

Thanks!

 

 

Share this post


Link to post
Share on other sites
Advertisement

I haven't done any Android development, but it looks like you can just make a test app to see if these things happen and log the results.

 

I did look at the docks, and I'm reading that the ACTION_DOWN event starts it off, and the ACTION_POINTER_DOWN is for other fingers.

I imagine there could be both an ACTION_POINTER_DOWN  and an ACTION_MOVE at the same time.  It would be difficult to use if the user had to press the screen with both fingers at the same time.

 

http://developer.android.com/training/gestures/multi.html

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!