0
\$\begingroup\$

I have pretty much the same controls on the race example of the engine. A AnalogOnScreenControl and a button defined by a Sprite.

The problem is, when I'm using the analog directional, touching the button does not trigger onAreaTouched on the button sprite.

I even tried adding the button to the child scene (controller scene) but it doesn't register the secondary touch on the button.

Am I doing something wrong or is this a bug?

UPDATE

I am doing some debugging and apparently if I touch the control base, it triggers it's onAreaTouched, and if I keep touching the controls and then touch the button (on the other side of the screen) the same onAreaTouched from the control base is triggered. He's the only one receiving the touch event.

I really can't understand why this is happening.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Found out the stupid engine option missing. When creating the EngineOptions you have to add this:

final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera);

engineOptions.getTouchOptions().setNeedsMultiTouch(true);

if(MultiTouch.isSupported(this)) {
    if(MultiTouch.isSupportedDistinct(this)) {
        Toast.makeText(this, "MultiTouch detected --> Both controls will work properly!", Toast.LENGTH_SHORT).show();
    } else {
        Toast.makeText(this, "MultiTouch detected, but your device has problems distinguishing between fingers.\n\nControls are placed at different vertical locations.", Toast.LENGTH_LONG).show();
    }
} else {
    Toast.makeText(this, "Sorry your device does NOT support MultiTouch!\n\n(Falling back to SingleTouch.)\n\nControls are placed at different vertical locations.", Toast.LENGTH_LONG).show();     
}
\$\endgroup\$
1
  • \$\begingroup\$ Make sure you mark this as accepted if you've solved the problem. \$\endgroup\$ Commented Mar 25, 2014 at 18:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .