changing images on a canvas with transitions
The following code makes different pics appear on my canvas. how do I make them change with nice transitions like fade and slide? setInterval(function () { if (i >= carInfo.length) { i = 0; } imageObj.onload = function () { context.clearRect(0, 0, canvas.width, canvas.height); context.fillText(textVar, 10, 10); context.drawImage(imageObj, 69, 50); }; imageObj.src = '' + carInfo[i].Picture + ''; var textVar = "" + carInfo[i].carType + ": " + carInfo[i].Description; // alert(textVar); i++ },2000); Fade in/out Can be done by gradually changing your images opacity using context.setGlobalAlpha