Button How to press another button while one is pressed

Hello, how to make a possibility to touch another button while one button is already pressed, or how to ‘unpress’ button when finger moves outside but is still touching ?

You’d have to fire a touch signal on the other button or something. Generally I’d expect UIs to not treat that second button as a press if I didn’t start there though.

If you want multitouch on iOS then you need to add this line to the AppController.mm file in the xcode project.

[eaglView setMultipleTouchEnabled:YES];

As for the unpress, it’s a little more complex. The default button functionality only detects a button touch has ended when the finger physically releases from the screen. I’m not sure if it’s possible without some hacking, it’s not really essential to be honest. It shouldn’t effect user experience too much.

I was asking because in most action games there is possibility to press left arrow with the same finger while right is already pressed, and somehow right arrow becomes released, and the same in other way. So this is the topic contains multitouching or should I look somewhere else ?

I’m not sure exactly what you’re trying to achieve. Multi touch basically allows more than 1 finger to touch the screen at any time. So you can detect 2 touches simultaneously for example.

The button state is dependent on the hardware signals, it’s only gona call “released”/“end” state when the finger physically removes from the device.

If you just want to make left and right buttons that work how you described, this is quite simple. Is that what you want?

Thank you for respond. What I want to make is to use left and right buttons which are at certain distance from them selves without physically removes finger from the device(finger all the time touches device while moving between buttons). Is it easy to do ?

Why don’t you make a touch based thumbstick instead? That sounds like it might do what you want.