Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Game development with Board Game Arena Studio
Post Reply
User avatar
bidulpik
Posts: 79
Joined: 17 November 2011, 09:02

Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Post by bidulpik »

Hi,
have you already tried to use mobile feature has touchescreen ?
like
dojo.connect(node, dojox.gesture.tap, function(e){});

what were your solution ?

all the best
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Post by Tisaac »

bidulpik wrote: 16 May 2021, 13:52 Hi,
have you already tried to use mobile feature has touchescreen ?
like
dojo.connect(node, dojox.gesture.tap, function(e){});

what were your solution ?

all the best
Out of curiosity, why would you need that ?
User avatar
bidulpik
Posts: 79
Joined: 17 November 2011, 09:02

Re: Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Post by bidulpik »

Hi,

in the backgammon on computer, tips are displayed on mouseover.
It is not possible on mobile.
I'd like to add a specific mobile action for tips.
May be gesture.tap.hold or something like that.

should I use instead a onmousedown and a setInterval ?

all the best
User avatar
XCID
Posts: 78
Joined: 26 March 2020, 01:45

Re: Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Post by XCID »

If you tap and and hold for a second or so, the tooltip should be displayed on mobile devices.
User avatar
bidulpik
Posts: 79
Joined: 17 November 2011, 09:02

Re: Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Post by bidulpik »

I've tried

dojo.query('.token').connect('dojox.gesture.tap.hold', this, 'hlodTap');

but it doenst work (even with tap, it is not detected by my mobile :s )
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Post by Tisaac »

XCID wrote: 17 May 2021, 09:32 If you tap and and hold for a second or so, the tooltip should be displayed on mobile devices.
It's too bugy.
On my current game, I've developped a "help/safe mode" to overcome this issue.
Basically you have a switch somewhere near top of screen to toggle this mode on/off, and once you are in this mode :
- all clicks related to an action are disabled , so no misclicks possible while trying to display the tooltip
- "tooltipable" elements get an "?" icon added on top left (and an "?" cursor)
- clicking on such an element now display the corresponding tooltip
- clicking again on it or anywhere else remove the tooltip.
I can share some parts of the code if you are interested.
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Touch screen connect ? dojo.connect(node, dojox.gesture.tap, function(e){}); ?

Post by Victoria_La »

You should add this to recipies wiki
Post Reply

Return to “Developers”