Search code examples
androidandenginehud

TouchEvents in andengine HUD on multiple areas


I have an andengine scene set up with a HUD. The HUD has 2 touch areas (rectangles). The onAreaTouched() works for both of them individually but when the left touch area is being touched the one on the right does not respond to touches and vice versa. It looks as if the two touch areas are running on the same thread. I need the two touch areas to respond simultaneously. How can I achieve this?


Solution

  • Do you have multitouch activated? Add this in the onCreateEngineOptions after creating your engineOptions

            yourEngineOptions.getTouchOptions().setNeedsMultiTouch(true);