pete1 Posted April 23, 2019 Share Posted April 23, 2019 I want to be a touch-like game, the pointerover on the mobile side has no effect. Quote Link to comment Share on other sites More sharing options...
pete1 Posted April 23, 2019 Author Share Posted April 23, 2019 I do not know what to do Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 23, 2019 Share Posted April 23, 2019 Please provide more information , my telepathy doesn't work on the words you wrote. @themoonrat is our pointer-master Quote Link to comment Share on other sites More sharing options...
themoonrat Posted April 23, 2019 Share Posted April 23, 2019 There is no such thing as pointerover for touch. It's the equivalent of mouseover, where you hover the cursor over an area but don't select it. Touch doesn't have that. Either you've pressed it or not. Quote Link to comment Share on other sites More sharing options...
Exca Posted April 23, 2019 Share Posted April 23, 2019 You can use touchstart and touchend to track if user is holding down. Or pointerdown and pointerup. Quote Link to comment Share on other sites More sharing options...
pete1 Posted April 24, 2019 Author Share Posted April 24, 2019 Thank you, this is a drag connection, the original mouse enters the phone to determine whether to connect, but the pointerover mobile is invalid, I get the local coordinates through e.data.getLocalPosition when pointermove To judge whether to enter the phone, maybe this is not the best solution. Nice day Quote Link to comment Share on other sites More sharing options...
pete1 Posted April 24, 2019 Author Share Posted April 24, 2019 This is really not a good idea, but I have no other good way. Quote Link to comment Share on other sites More sharing options...
botmaster Posted April 24, 2019 Share Posted April 24, 2019 You need to choose your words carefully, "the original mouse enters the phone to determine whether to connect" doesn't mean much because: 1. there's no mouse to use on a phone 2. "the mouse enters the phone" doesn't mean anything to us. It might be very clear for you but it really means nothing for us. 3. "to determine whether to connect". Again, this might be very obvious for you but it really doesn't mean anything for anyone who doesn't know what your app is supposed to do. As Ivan said it first, telepathy doesn't work here, we don't know what you are talking about because we don't know what your app does. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 24, 2019 Share Posted April 24, 2019 > As Ivan said it first, telepathy doesn't work here, I mean sometimes it works but not in this case, sorry Quote Link to comment Share on other sites More sharing options...
pete1 Posted April 25, 2019 Author Share Posted April 25, 2019 In the color doll pointerdown, then pointermove, when the pointerover phone Sprite, confirm the connection, there is no pointerover on the mobile side, I would like to know if there is a better alternative method, I am deeply sorry, maybe my expression is not clear, maybe it is my Google Translation does not work accurately, thank you for your patience. Quote Link to comment Share on other sites More sharing options...
pete1 Posted April 25, 2019 Author Share Posted April 25, 2019 patient Reply Quote Link to comment Share on other sites More sharing options...
botmaster Posted April 25, 2019 Share Posted April 25, 2019 using a pointermove event it's fairly simple to check if an area contains the pointer coordinates, could be a hitarea, a rectangle you set, ect ... So set your "phone" areas, when moving check if those areas contain the pointer coordinates and voila. Quote Link to comment Share on other sites More sharing options...
trusktr Posted January 12, 2021 Share Posted January 12, 2021 (edited) pointerover (and similar events) work on mobile when the finger is down, but you must opt into that behavior. For example, once `pointerdown` fires, if you move your finger, you can use `pointerover` as it moves onto different elements. See here for details: https://github.com/w3c/pointerevents/issues/346 Here is a demo that works on mobile (drag with your finger starting on the cell on which the cube is): https://cdpn.io/trusktr/debug/eYdPOKb Edited January 12, 2021 by trusktr Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.