Jump to content

On Android Must Tap Twice To Press Button?


JeZxLee
 Share

Recommended Posts

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...