MultiTouch Extension!

  ... information about changes and new features of AndEngine,

MultiTouch Extension!

Postby Nicolas Gramlich » Wed Jul 14, 2010 7:45 pm

Hello Community,

just today I finished the AndEngineMultiTouchExtenison.
(It works only when the Android-Version and the Device support it. :!:)

Example-Code: The following video shows me running the MultiTouchExample on my Nexus, which suffers from the "poor" multitouch capabilities of the display of the Nexus.
Somebody has an Evo 4G or a Milestone/Droid :?: It should work with those :!:


Hope this helps some of you :)

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: MultiTouch Extension!

Postby Radzell » Wed Jul 14, 2010 8:08 pm

Great Job of integration so all i need is to add some preference to the engine and it should work if supported so there no extra lines of code to the game interface thanks ill add it right it now.
Radzell
 
Posts: 465
Joined: Sun Jul 04, 2010 8:52 am

Re: MultiTouch Extension!

Postby Nicolas Gramlich » Wed Jul 14, 2010 11:37 pm

Hi,

unless your game-concept isn't totally useless without multitouch, you should still support singletouch somehow.

The only thing in your code that changes when you use the MultiTouchController (instead of the default default SingleTouchController) is that the method getPointerID() of the TouchEvent will return a different ID for each finger. Thats a little different from the way Android itself handles MultiTouch, by squeezing all fingers into on MotionEvent.

Basically if you start your implementation by remembering the "activePointerID" you are on the safe side for both Single and MultiTouch. Its like associating the (active)PointerID when the object the finger goes down (ACTION_DOWN) on an object and only reacting MOVE/UP-Actions of TouchEvents where the PointerID is the same as the activePointerID.
This is how the OnScreenControls do it and it seems to work very well.
See: http://code.google.com/p/andengine/sour ... ntrol.java

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany


Return to Updates

Who is online

Users browsing this forum: No registered users and 3 guests