Sign in to follow this  
trinoo

scroll/zoom whole html body making a swipe on canvas on Android? autoPreventDefault false not work

Recommended Posts

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);

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.