帧它不工作:帆布动画 - 通过框架
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