mwatt Posted June 5, 2016 Share Posted June 5, 2016 Hi all, In the past I've made do with detecting taps on sprites. I'm now looking into a game in which I might wish to use gestures, or do a mixture of detecting taps and other gestures. Ideally any mechanism that provided this for phone would do something analogous in a regular desktop browser that has no touch capability but uses mouse instead. Anyone care to make a recommendation? It could be that native Phase provides enough - but perhaps there is a really sweet add-in out there. If anyone has experience with solid, popular solutions I would appreciate the tip. Thank you, Mike Link to comment Share on other sites More sharing options...
mattstyles Posted June 5, 2016 Share Posted June 5, 2016 Hammerjs used to be popular but, like jQuery, I'm not sure its relevant any more, using standard touch and mouse handlers is about as simple as it can get (I'm not a Phaser expert but doesn't Phaser wrap these methods almost 1-1? No point in recreating a simple and clean API with subtle differences, just copy it). The pointer API was supposed to unify these cross-platform but I'm not sure what support is or whether that spec is even feature complete. The only interaction that is truly shared between both input methods is a click, hence why most of the web has changed to honour the mighty click. Hover obviously becomes useless on mobile and pinch/expand useless on desktop, and by useless I mean very hard to mock for the other input device. Swipe is very much an awkward gesture using a mouse and just about impossible for those users who can not use a mouse or do not like to use a mouse. These concerns are extremely limiting for an app trying to be cross-platform, but are more of a design consideration and than a technical one. As a web developer I try to advocate cross-platform apps as a strength of the web but there are many many situations where it is hard to argue against specific variants of apps for the platform they are designed to run on. Technically handling interaction is usually fairly straight forward, but from a design point of view its very tough and becomes far more difficult as you start to add interaction methods so whilst these complex gestures sound like a good thing, in practise, most apps/games only require a couple. This lets users immediately focus on interacting with your app rather than trying to work out how to interact with your app. Umz and drhayes 2 Link to comment Share on other sites More sharing options...
mwatt Posted June 5, 2016 Author Share Posted June 5, 2016 Matt, Thanks a bunch. I just took a quick look at Hammerjs and I liked what I saw. I'll have a look at what Phaser provides natively for swipe before I make my decision. However, I like the fact that the hammer people have a nice easy 300 ms click fix and I like the fact that the hammertime library seems to provide mouse or touch equivalents -contextually for the hardware. On the face of it, this appears to be what I was hoping for. Your comments on design are also appreciated and I concur. mattstyles and drhayes 2 Link to comment Share on other sites More sharing options...
Recommended Posts