Pixi.js: autoPreventDefault 不起作用。 仍然无法触摸滚动。

创建于 2018-04-02  ·  4评论  ·  资料来源: pixijs/pixi.js

你好,首先,感谢精彩的图书馆。
Pixi 太棒了,我等不及 v5 出来了!
现在,我遇到了一个问题。
我无法使用移动滚动条滚动画布。
我正在使用 ^4.7.1 版本

这是我的代码

    this.App = new Application(
      Math.min(window.innerWidth, window.screen.width),
      Math.min(window.innerHeight, window.screen.height),
      {
        backgroundColor: `0x${backgroundColor}`,
        resolution: window.devicePixelRatio
      }
    );

    this.App.renderer.plugins.interaction.autoPreventDefault = false; // notice that after adding this line still can't have scroll work.
    this.App.renderer.autoResize = true;

最有用的评论

    this.App.renderer.plugins.interaction.autoPreventDefault = false;
    this.App.renderer.view.style.touchAction = 'auto';

所有4条评论

    this.App.renderer.plugins.interaction.autoPreventDefault = false;
    this.App.renderer.view.style.touchAction = 'auto';

@rockmandash renderer.view.style.touchAction = 'auto';为我成功了!

这是在某个地方记录的吗? 看起来 pixi 在画布元素本身上设置了这个 css 规则( touch-action )?

该线程已被自动锁定,因为它关闭后没有任何最近的活动。 请针对相关错误打开一个新问题。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

gigamesh picture gigamesh  ·  3评论

courtneyvigo picture courtneyvigo  ·  3评论

madroneropaulo picture madroneropaulo  ·  3评论

lucap86 picture lucap86  ·  3评论

YuryKuvetski picture YuryKuvetski  ·  3评论