Jump to content

How does the GUI support multi-touch?


renjianfeng
 Share

Recommended Posts

Hi, I have three button on the GUI interface, I mainly want to implement a game handle, a button says "fire", the other two buttons said "direction", now the problem is, when I press the two buttons at the same time, "onPointerDownObservable" event is executed correctly, but "onPointerUpObservable" event only carried out the last of the button, how to set up a web page or other parameters?:)

thinks!!!

Link to comment
Share on other sites

I'm not sure I repro'd exactly what you are seeing but I did notice that touch both buttons at once and then releasing causes a right click event to be fired which might be interrupting your up/down events. I disabled right clicking on the canvas using 

$("#renderCanvas").bind("contextmenu", ()=>{
return false
})
 
This stops the right click event and up/down events seem to work expected now for me here (tested with: Chrome + laptop with touchscreen): https://www.babylonjs-playground.com/#XCPP9Y#533
 
Let me know if this still doesn't fix your issue.
Link to comment
Share on other sites

On 5/30/2018 at 2:20 AM, trevordev said:

I'm not sure I repro'd exactly what you are seeing but I did notice that touch both buttons at once and then releasing causes a right click event to be fired which might be interrupting your up/down events. I disabled right clicking on the canvas using 

$("#renderCanvas").bind("contextmenu", ()=>{
return false
})
 
This stops the right click event and up/down events seem to work expected now for me here (tested with: Chrome + laptop with touchscreen): https://www.babylonjs-playground.com/#XCPP9Y#533
 
Let me know if this still doesn't fix your issue.

Please ignore this stupid question of mine, because it works well in the latest version. Thank you for your advice.:D

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