我正在使用easlejs phonegap进行
HTML5游戏,并且遇到问题,每当您在画布上点击/ touch / mousedown时,屏幕会闪烁.
下面是我创建的非常简单的代码来测试问题,看看它是否与easlejs有关.从代码中可以看出,它与easlejs无关,只是一个html5 / phonegap问题.
你可以看到我也试过没有选择的CSS样式没有运气.
#canvas
{
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
}
var canvas = document.getElementById("canvas");
canvas.addEventListener("mousedown",function(e)
{
var ctx = canvas.getContext("2d");
var x = Math.random() * 320;
var y = Math.random() * 480;
var w = Math.random() * 100;
var h = Math.random() * 100;
ctx.fillStyle = "#FF0000";
ctx.fillRect(x,y,w,h);
},false);