Phaser 可滚动文本框教程不适用于移动设备

问题描述

我在我的游戏中重新创建了 scrolling text box tutorial。但是,它在移动设备上运行时有点问题。例如,如果我向上滑动,文本首先向下移动一秒钟,然后跟随我的手指向上移动。如果您在移动设备上打开教程,就会看到问题。有什么想法吗?我复制了下面的代码

var graphics = scene.make.graphics();

graphics.fillRect(x,y + 10,width,height - 20);

var mask = new Phaser.display.Masks.GeometryMask(scene,graphics);

var text = scene.add.text(x + 20,y + 20,content,{ 

  fontFamily: 'Assistant',fontSize: '28px',color: '#000000',wordWrap: { width: width - 20 } 

}).setorigin(0);

text.setMask(mask);

var minY = height - text.height - 20;

if (text.height <= height - 20) {

  minY = y + 20;

}

//  The rectangle they can 'drag' within

var zone = scene.add.zone(x,y - 3,height + 6).setorigin(0).setInteractive({useHandCursor: true});

zone.on('pointermove',function (pointer) {

  if (pointer.isDown) {

    text.y += (pointer.veLocity.y / 10);

    text.y = Phaser.Math.Clamp(text.y,minY,y + 20);

  }

});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)