Problem with the multitouch example (setTouchController)

  ... the MultiTouch Extension for AndEngine.

Problem with the multitouch example (setTouchController)

Postby lcsd93 » Fri Aug 26, 2011 11:26 pm

Hello, i've a problem using the multitouch extension, I just copy/paste the part of the engine in the MultiTouchExample and i've that:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public Engine onLoadEngine() {
  2.             this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
  3.             final Engine engine=new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));
  4.            try {
  5.                 if(MultiTouch.isSupported(this)) {
  6.                         engine.setTouchController(new MultiTouchController());
  7.                         if(MultiTouch.isSupportedDistinct(this)) {
  8.                                 Toast.makeText(this, "MultiTouch detected --> Drag multiple Sprites with multiple fingers!", Toast.LENGTH_LONG).show();
  9.                         } else {
  10.                                 Toast.makeText(this, "MultiTouch detected --> Drag multiple Sprites with multiple fingers!\n\n(Your device might have problems to distinguish between separate fingers.)", Toast.LENGTH_LONG).show();
  11.                         }
  12.                 } else {
  13.                         Toast.makeText(this, "Sorry your device does NOT support MultiTouch!\n\n(Falling back to SingleTouch.)", Toast.LENGTH_LONG).show();
  14.                 }
  15.         } catch (final MultiTouchException e) {
  16.                 Toast.makeText(this, "Sorry your Android Version does NOT support MultiTouch!\n\n(Falling back to SingleTouch.)", Toast.LENGTH_LONG).show();
  17.         }
  18.  
  19.             return engine;
  20.     }
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


The problem is that i have an error with the method setTouchController, that's it:
The method setTouchController(ITouchController) in the type Engine is not applicable for the arguments (MultiTouchController)

Eclipse propose me to cast the new multitouchcontroller but we know it's not the solution :(

Thank you for your help, lucas!
lcsd93
 
Posts: 13
Joined: Fri Aug 26, 2011 10:02 pm

Re: Problem with the multitouch example (setTouchController)

Postby lcsd93 » Sat Aug 27, 2011 9:49 am

Could it be because of my andengine.jar or MultitouchExtension.jar?
lcsd93
 
Posts: 13
Joined: Fri Aug 26, 2011 10:02 pm

Re: Problem with the multitouch example (setTouchController)

Postby lcsd93 » Sun Aug 28, 2011 11:15 am

With the debugger i've that:
"The JAR file ....\android-sdk-windows\platforms\android-8\android.jar has no source attachment."
I don't think it's the problem but it could...
lcsd93
 
Posts: 13
Joined: Fri Aug 26, 2011 10:02 pm

Re: Problem with the multitouch example (setTouchController)

Postby lcsd93 » Sun Aug 28, 2011 3:28 pm

That desappear when i put off the lines:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. try {
  2.                 if(MultiTouch.isSupported(this)) {
  3.                         engine.setTouchController(new MultiTouchController());
  4.                         if(MultiTouch.isSupportedDistinct(this)) {
  5.                                 Toast.makeText(this, "MultiTouch detected --> Drag multiple Sprites with multiple fingers!", Toast.LENGTH_LONG).show();
  6.                         } else {
  7.                                 Toast.makeText(this, "MultiTouch detected --> Drag multiple Sprites with multiple fingers!\n\n(Your device might have problems to distinguish between separate fingers.)", Toast.LENGTH_LONG).show();
  8.                         }
  9.                 } else {
  10.                         Toast.makeText(this, "Sorry your device does NOT support MultiTouch!\n\n(Falling back to SingleTouch.)", Toast.LENGTH_LONG).show();
  11.                 }
  12.         } catch (final MultiTouchException e) {
  13.                 Toast.makeText(this, "Sorry your Android Version does NOT support MultiTouch!\n\n(Falling back to SingleTouch.)", Toast.LENGTH_LONG).show();
  14.         }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
lcsd93
 
Posts: 13
Joined: Fri Aug 26, 2011 10:02 pm

Re: Problem with the multitouch example (setTouchController)

Postby lcsd93 » Sun Aug 28, 2011 5:02 pm

Ok, Aaronds, a man on the IRC channel helped me and i solved the problem:
Don't export the MultitouchExtension in .jar, just link the source to your project and that's ok!

(i posted the solution for those who were in the same situation ;))
lcsd93
 
Posts: 13
Joined: Fri Aug 26, 2011 10:02 pm

Re: Problem with the multitouch example (setTouchController)

Postby Anvar » Thu Dec 15, 2011 1:58 am

I don't get it

I can't do anything with Extensions because I don't know where fu*** they are


I need the MultitouchExtension.jar or something

I'm trying to do my first application, but I have nothing

Help me!!

:cry: :cry: :cry: :cry:
Anvar
 
Posts: 3
Joined: Thu Dec 15, 2011 1:40 am

Re: Problem with the multitouch example (setTouchController)

Postby evilcandybag » Fri Dec 16, 2011 9:49 pm

You can find the link to the extension source code in this subforum (sticky post).
* Import the source into Eclipse. Easiest way is to install the Mercurial plugin and import the project.
* Right click the src folder in the project. Choose Export.
* Under Java, choose JAR file.
* Make sure only the files in the src folder are marked for inclusion.
* Check the boxes: "Export generated class..." and "Export Java source...".
* Choose a destination and name for the jar-file.
* Click finish.

You may need to link the AndEngine source to the extension, you can for example add andengine.jar as an external archive.
evilcandybag
 
Posts: 3
Joined: Sat Aug 27, 2011 11:33 pm

Re: Problem with the multitouch example (setTouchController)

Postby Anvar » Thu Jan 26, 2012 5:46 pm

Ok, I´ll try it, but for now I only clone the extension and copy the files. Now I get the files, that was that I needed.
Thanks
Anvar
 
Posts: 3
Joined: Thu Dec 15, 2011 1:40 am


Return to MultiTouch

Who is online

Users browsing this forum: No registered users and 1 guest