Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable multitouch in libgdx

Tags:

android

libgdx

I use Stage and Actors in my project. Can I disable and enable multitouch in runtime? I'm using libgdx 0.9.7.

Sorry for my English.

like image 340
Slavik Voloshyn Avatar asked Jan 21 '26 22:01

Slavik Voloshyn


1 Answers

Add an InputMultiplexer, add a custom InputProcessor that returns false in the touch methods if the pointer index > 0. Then add the Stage to the input multiplexer. That way, the first input processor will swallow all events of second/third/... touches.

From libgdx forum.

like image 130
Slavik Voloshyn Avatar answered Jan 24 '26 13:01

Slavik Voloshyn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!