Touch Gesture Problem: Clicking Newly Moved Object

Get help using Construct 2

Post » Sun Feb 22, 2015 3:16 am

Hi guys, I'm currently working on a menu system for an experimental tower defense game similar to Radiant Defense (the menu is an exact rip-off, I know, but I'm just using it as a base) and I'm using the On Tap Object condition.

My problem is, since I'm just moving my buttons on-and-off the screen (on a non-scrolling layer), the 6th button on the top menu happened to be perfectly aligned with the Cancel (3rd) button on the 4th menu, which causes the button to "seemingly" not do anything -- while in fact, it is actually moving to the 4th menu and quickly touching the Cancel button so the 1st menu is re-shown (it all happens so fast it can't be seen) -- the proof I know the 6th button works is because if I move it elsewhere it shows the 4th menu just fine. I know I'm only performing the Tap Gesture once since I'm keeping the left mouse button clicked when I touch the button.

My question is, is there a way to prevent the On Tap Object condition from executing multiple times? I'm halfway tempted to just use one big menu screen where the buttons will never stack over each other, but that seems like a bad workaround. :|
You do not have the required permissions to view the files attached to this post.
(insert subliminal message here.)
B
15
S
4
G
1
Posts: 18
Reputation: 955

Post » Sun Feb 22, 2015 9:14 am

Give an instance variable like 'tap_times'. So when an object being touched add 1 to the instance variable 'tap_times'. Then on your desired condition event add 'tap times' <= 1 then do the rest action.
ImageImageImage
B
86
S
40
G
17
Posts: 660
Reputation: 17,834

Post » Sun Feb 22, 2015 9:48 am

Thanks for trying to help, I really appreciate it :) , but unfortunately it didn't solve the problem :|

However, I have figured out a workaround:
Just before the final action in the On Tap Object event, add a System.Wait for 0.01 seconds.
Apparently that was enough to keep the Touch Behavior from executing right after the function was called so the re-check on the Cancel button's Touch event never fired unnecessarily.

I hope this issue gets fixed soon, if it actually is an issue or just a mouse-emulating-touch limitation.
(insert subliminal message here.)
B
15
S
4
G
1
Posts: 18
Reputation: 955

Post » Sun Feb 22, 2015 2:39 pm

Well I never use gesture input only basic touch function such as 'On touched object' or 'Is touching object'. Using these basic touch option I am able to emulate mouse gesture.
ImageImageImage
B
86
S
40
G
17
Posts: 660
Reputation: 17,834


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests