I have a flash animation that I am trying to convert to HTML5. Now I took out all the images. For example, in manual animation, I took images of all hand images. I made a canvas with a basic pattern, but I do not know how to replace these images with a frame.
function draw(){ var canvas = document.getElementById('canvas'); if(canvas.getContext){ // canvas animation code here: var ctx = canvas.getContext('2d'); var lhs = new Image(); lhs.src = "images/left_hnd_1.png"; lhs.onload = function(){ ctx.drawImage(lhs, 293, 137); } } else { // canvas unsupported code here: document.getElementById('girl').style.display = "block"; } }
Now I have three more frames for this image. left_hnd_2.png, left_hnd_3.png and left_hnd_4.png. I would use one image, but the difference in frames is too big to do it with one image. How can I revive this given the time difference.
Any ideas would be highly appreciated. Thanks!
source share