On Tap Screen - node for handling touches (double, triple...)

On Tap Screen - node for handling touches (double, triple…)
on_tab_screen_v2

Input parameters:

  • Duration - time during which the number of touches is counted (default value is 0.3 seconds);
  • Time Between Taps - the time that must elapse between touches (default value is 0). So that you can “rein in” the fastest finger. =)
  • Number Of Taps - the number of touches that need to be done to execute the event (default value is 2).

Output parameters:

  • Coords - coordinates of the last touch.

I’m waiting for suggestions on the name, additional features.

As a development, you can set a sign, setting which, you can simply count how many touches the user has made in a time, but I’m afraid this will complicate the node (the algorithm is simple and you can simply do it with a timer and a Surface node). What do you think?

Scripts: OnTapScreen.zip

5 Likes

Great node! But shouldn’t it be On Tap Screen instead of On Tab Screen?

2 Likes

Corrected the name in the header (stupid mistake) :sweat_smile:

As an On Touch Screen option?

The name may be a thing that belongs to Started and Released. On Tap Screen is a good and descriptive name.

I think that the Duration input is not that useful as an input (because the user will not be able to “count” this short time and may case some troubles. Tapping without this time counted seems better.

The two other inputs would be better with shorter names:

Time Between Taps can be Interval
Number Of Taps can be Repetitions

Also there will have a performance gain by removing the possibility to place inputs in this node, like the other inputs nodes we already have. You just need to ask yourself what will be exactly the usability of this inputs first to see if it deserves these inputs.

1 Like

The options are interesting. I tried to indicate the parameters succinctly and informatively. If other users confirm, then I will rename.

The default value specified (300ms) is a frequently used time for such purposes. It can be adjusted to create game mechanics (for example clickers). I wouldn’t add it just like that. I see this as a potential use.

I did not understand what the increase in productivity would be, because the algorithm will still be the same, only the values change that will be set by default without input parameters. What is optimization here?

I am not sure about the performance gain by removing those inputs, i only tough that may have a reason for the other inputs nodes to don’t have that. Anyway we can test it later :slight_smile:

New Version
on_tab_screen_v3

Input parameters:

  • Duration - time during which the number of touches is counted (default value is 0.3 seconds);
  • Interval - the time that must elapse between touches (default value is 0);
  • Repeat - the number of touches that need to be done to execute the event (default value is 2).

Output parameters:

  • Done - action for a successful completed action;
  • Tap - action on each touch;
  • Tap Number - how many times the user has already touched the screen;
  • Coords - coordinates of the touch.

Scripts: OnTapScreen.zip

1 Like

Now it is perfect. Maybe you would like to make a PR :slight_smile:

I will send if there are no more offers

1 Like

And most importantly they forgot =)
A new version.
on_tab_screen_v4

Input parameters:

  • Duration - time during which the number of touches is counted (default value is 0.3 seconds);
  • Interval - the time that must elapse between touches (default value is 0);
  • Repeat - the number of touches that need to be done to execute the event (default value is 2).

Output parameters:

  • Done - event for a successful completed action;
  • Fail - an event for a failed action;
  • Tap - event on each touch;
  • Tap Number - how many times the user has already touched the screen;
  • Coords - coordinates of the touch.

Scripts: OnTapScreen.zip

2 Likes