幀它不工作:帆布動畫 - 通過框架
var ctx=document.getElementById("mycanvas").getContext('2d');
var image = new Image();
var firtImg=1;
var lastImg=75;
window.requestAnimFrame = (function(callback)
{
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback)
{
window.setTimeout(callback, 1000/60);
};
}
)();
function draw(){
//loop here for loading system
if(firstImg< lastImg){
image.src = 'iglesiafls'+(firstImg++)+'.png';
ctx.drawImage(image,0,0,550,800,0,0,550,800);
requestAnimFrame(draw);
render();
}
}
我想要實現使用帆布75個圖像幀動畫幀。
你的函數*渲染*實際存在嗎? – m90