我在chrome浏览器调试模式,手机模式下,只要在界面上一点就会出现那个错误。
index.html <script type=“text/javascript” src="./js/phaser.min.js"></script> <div id=“game”></div> <script type=“text/javascript” src="./js/test.js"> </script> <style type=“text/css”> body { padding: 0; margin: 0; } #game canvas{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto;
}
</style>
test.js var game = new Phaser.Game(800, 600, Phaser.CANVAS, ‘game’, { create: create, render: render });
function create() { // game.stage.backgroundColor = ‘#454645’; // // 各种事件 // game.input.onUp.add(function() { // console.log(‘UP’); // }); // game.input.onDown.add(function() { // console.log(‘DOWN’); // }); // game.input.onTap.add(function() { // console.log(‘TAP’); // }); }
function render() { // 调试信息 // game.debug.pointer(game.input.mousePointer); // game.debug.pointer(game.input.pointer1); // game.debug.pointer(game.input.pointer2); }
你的phaser版本太低了,请更新