trinoo Posted September 21, 2017 Share Posted September 21, 2017 Is there any possibility, how to achieve scrolling or zooming of whole HTML body by making a swipe on canvas on Android (Chrome)? The only thing I was able to find when searching over internet and Pixi docs is using a property "autoPreventDefault()". But even when I set it to false, it does not work. What Am I missing here? Is there any simple code example of autoPreventDefault? When you try to zoom-in the page outside the canvas and then move over it (canvas fill whole view port) - you are now in a trap, because there is no way how to move the canvas or zoom-out back. example: var renderer = autoDetectRenderer(800, 500,{antialias: true, transparent: false, resolution: 1}); renderer.plugins.interaction.autoPreventDefault = false; renderer.view.style.border = "1px dashed black"; renderer.backgroundColor = 0xDDDDDD; renderer.autoResize = true; document.body.appendChild(renderer.view); renderer.render(stage); Quote Link to comment Share on other sites More sharing options...
trinoo Posted September 25, 2017 Author Share Posted September 25, 2017 Found it by myself - so in case anyone will find it handy, you have to use also - along with autoPreventDefault = false: renderer.view.style['touch-action'] = 'auto'; or any other value according to CSS touch-action to overwrite the default value 'none' ivan.popelyshev, !untrue and Taz 2 1 Quote Link to comment Share on other sites More sharing options...
!untrue Posted October 7, 2017 Share Posted October 7, 2017 Thanks. I've been looking for this. This has been driving me insane for ages. I've previously resorted to patching pixi.js itself, but I hate doing that. What I find weird is how this isn't more of an issue for people. Quote Link to comment Share on other sites More sharing options...
Thibka Posted September 24, 2019 Share Posted September 24, 2019 Thanks trinoo! I'm also surprised that's not more of a problem for people ? 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.