none-9999 Posted January 4, 2018 Share Posted January 4, 2018 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 4, 2018 Share Posted January 4, 2018 Have you tried creating your engine with adaptToDeviceRatio true as 4th parameter? ie: using 0.9 may work on your mobile device, but probably won't on mine engine = new BABYLON.Engine(canvas, true, {}, true); Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 5, 2018 Share Posted January 5, 2018 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. Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 5, 2018 Share Posted January 5, 2018 This issue was resolved, as far as I know. I noticed you are using Babylon 3.0, have you tried 3.1 ? just as a test, would be great to know if it still exists. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
none-9999 Posted January 5, 2018 Author Share Posted January 5, 2018 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. Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 5, 2018 Share Posted January 5, 2018 And now we all want to play the game once it's done Quote Link to comment Share on other sites More sharing options...
none-9999 Posted January 5, 2018 Author Share Posted January 5, 2018 In about 2 months ... it will be over. It was for the dream build play but I could not finish it by a lot of work .. Here I upload the development progress https://web.facebook.com/DiyoGames/ brianzinn 1 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.