Not working onAreaTouched when using Multitouch

  ... the MultiTouch Extension for AndEngine.

Not working onAreaTouched when using Multitouch

Postby gforcer18 » Wed Aug 10, 2011 6:46 am

Hi :D

Cant make onAreaTouched working. Using Multitouch Extension to scroll map and zooming camera.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. AnimatedSprite mAnimation = new AnimatedSprite(0, 0, tiledTextureRegion.clone())
  2. {
  3.  @Override
  4.  public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY)
  5.  {
  6.   return(true);//Never Happens
  7.  }
  8. }
  9.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Using to attach sprite to scene:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. mScene.attachChild(mAnimation);
  2.  
  3. mScene.registerTouchArea(mAnimation);
  4.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


In LoadScene using:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. scene = new Scene();
  2.  
  3. scene.setOnAreaTouchTraversalFrontToBack();
  4.  
  5. scene.setTouchAreaBindingEnabled(true);
  6.  
  7.                 mScrollDetector = new SurfaceScrollDetector(this);
  8.                
  9.                 if(MultiTouch.isSupportedByAndroidVersion())
  10.                 {
  11.                         try
  12.                         {
  13.                                 mPinchZoomDetector = new PinchZoomDetector(this);
  14.                         }
  15.                         catch (final MultiTouchException e)
  16.                         {
  17.                                 mPinchZoomDetector = null;
  18.                         }
  19.                 }
  20.                 else
  21.                 {
  22.                         mPinchZoomDetector = null;
  23.                 }
  24.  
  25. scene.setOnSceneTouchListener(this);
  26.  
  27. return(scene);
  28.  
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


Please help, tell me what i'm doing wrong :|
gforcer18
 
Posts: 9
Joined: Wed Aug 10, 2011 6:31 am
Location: Russia, Izhevsk

Return to MultiTouch

Who is online

Users browsing this forum: No registered users and 3 guests