I am using jCanvasSript for canvas animation.
I put an image element in a canvas and then want to move it using the translate method.
Is this possible and if so, how do I implement my desired behviour?
My code:
HTML:
<canvas id="bug_animte" width="990" height="285">
This text is displayed if your browser
does not support HTML5 Canvas.
</canvas>
Javascript:
function start_1(idCanvas)
{
jc('#myCircle_1').translate(50,20);
}
function onload_1(idCanvas)
{
var img=new Image();
img.src="images/body.png";
img.onload=function(){
jc.start(idCanvas);
jc.image(img,100,100).id('myCircle_1');
jc.start(idCanvas);
}
}
$(document).ready(function(){
onload_1('bug_animte');
var x = setTimeout(function(){
start_1('bug_animte')
},100);
});