MackeyK24 Posted June 9, 2018 Share Posted June 9, 2018 Yo @davrous or @Deltakosh What impact does the css classes have on the babylon game canvas, why use them, when to use them and when not to: touch-action: none; -ms-touch-action: none; Quote Link to comment Share on other sites More sharing options...
brianzinn Posted June 9, 2018 Share Posted June 9, 2018 If you have that on your canvas then the browser won't intercept - ie: pinching and zooming are handled exclusively by the browser by default: https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action So, use those CSS classes when you want to have access to those touch events in code. ie: when using PEP. Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted June 9, 2018 Author Share Posted June 9, 2018 So then for the normal game scenario, do want to put those css tags on the canvas or not... do we always want those events or just sometimes when we actually need to capture pinch ans zoom I am just trting to figure out wheather i should set those css tags on the canvas by default for all projects or not Quote Link to comment Share on other sites More sharing options...
brianzinn Posted June 9, 2018 Share Posted June 9, 2018 My understanding is that you need that CSS for pointer events to be generated. PEP is just a polyfill, so if you wanted pointer events on older browsers. I would say by default yes - https://doc.babylonjs.com/babylon101/first. Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted June 9, 2018 Author Share Posted June 9, 2018 Thanks 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.