JeZxLee Posted August 7, 2017 Share Posted August 7, 2017 Hi, I am having some problem with touch input on Android devices. I have to touch screen twice to register a button click? renderer.plugins.interaction.on('pointerdown', function(event) { MouseCoordinates = event.data.global; }); MouseX = Math.floor( MouseCoordinates.x / (widthScale) ); MouseY = Math.floor( MouseCoordinates.y / (heightScale) ); Is something wrong with the code above? Thanks! JeZxLee Quote Link to comment Share on other sites More sharing options...
Taz Posted August 7, 2017 Share Posted August 7, 2017 If you put a console.log("TAP") statement in the 'pointerdown' handler function does it get logged after tapping once or do you have to tap twice to see the message? Also does the bottom code block run every frame to update MouseX and MouseY (i.e. each time before you use them)? Otherwise maybe you'll need to update them in the event-handler function after you update MouseCoordinates (and also whenever widthScale or heightScale changes). Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted August 7, 2017 Author Share Posted August 7, 2017 Sorry, but how do I debug this on Android browser? I don't know how to open the log file on Android... JeZxLee Quote Link to comment Share on other sites More sharing options...
themoonrat Posted August 7, 2017 Share Posted August 7, 2017 you can connect an android device to your pc via usb with developer mode and usb debugging enabled on your android device. Load up the game in chrome on your phone on your pc, go to chrome://inspect/#devices, and you can inspect & debug the browser like normal Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted August 7, 2017 Author Share Posted August 7, 2017 I don't think that's going to work, I use Linux not Windows... JeZxLee Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted August 7, 2017 Author Share Posted August 7, 2017 I think it's a problem with my button GUI code because the volume button works fine on Android. Let me hit it with a hammer and I will report back later, thanks! JeZxLee Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted August 7, 2017 Author Share Posted August 7, 2017 I got it working now... Check out the project in my signature! JeZxLee Quote Link to comment Share on other sites More sharing options...
xerver Posted August 7, 2017 Share Posted August 7, 2017 1 hour ago, JeZxLee said: I don't think that's going to work, I use Linux not Windows... JeZxLee Not sure what gave you that idea, I feel like you need to work on your google-fu: https://developers.google.com/web/tools/chrome-devtools/remote-debugging/ 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.