Jump to content

error coordinates GUI & setHardwareScalingLevel


none-9999
 Share

Recommended Posts

Oops - you are right, as setting true would only force hardwareScaling to 1:
https://github.com/BabylonJS/Babylon.js/blob/8dd6a69e79e9f8665f9ca648a82c9a532161ced1/src/Engine/babylon.engine.ts#L1007
 

I've ran into this issue a few times, so I would start here
- What do you get from window.devicePixelRatio - just wondering why you ended up with 0.9, but that hasn't been an issue for me.
- Why are only calling an engine.resize() when playing "if (jugando)" - if you have resized the canvas then I think you would want to call that either way.
- Are you using a second viewport or multiple cameras (scene.cameraToUseForPointers)?

Otherwise some of your canvas may be off screen (you can see this in Chrome by inspect element - check this also for calculated width/height that it matches your code). It could be a driver issue - I had a problem where my clicks on my laptop were off on certain resolutions.

If those don't work then post the code with the alert.

Link to comment
Share on other sites

9 hours ago, brianzinn said:

Oops - you are right, as setting true would only force hardwareScaling to 1:
https://github.com/BabylonJS/Babylon.js/blob/8dd6a69e79e9f8665f9ca648a82c9a532161ced1/src/Engine/babylon.engine.ts#L1007
 

I've ran into this issue a few times, so I would start here
- What do you get from window.devicePixelRatio - just wondering why you ended up with 0.9, but that hasn't been an issue for me.
- Why are only calling an engine.resize() when playing "if (jugando)" - if you have resized the canvas then I think you would want to call that either way.
- Are you using a second viewport or multiple cameras (scene.cameraToUseForPointers)?

Otherwise some of your canvas may be off screen (you can see this in Chrome by inspect element - check this also for calculated width/height that it matches your code). It could be a driver issue - I had a problem where my clicks on my laptop were off on certain resolutions.

If those don't work then post the code with the alert.

Hi, 0.9 was a random value, if I had placed 0.5, it would go out of the screen to the right and I no longer heard any touch event.

"engine resize" is why that function is called when starting (body onload) so it is inside that if.

There is only one canvas .. in the DOM, (and a button for fullscreen)

thank you very much.

 

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