Skip to content

Instantly share code, notes, and snippets.

@sters
Created January 1, 2014 12:22
Show Gist options
  • Select an option

  • Save sters/8207603 to your computer and use it in GitHub Desktop.

Select an option

Save sters/8207603 to your computer and use it in GitHub Desktop.
ほげほげ
drawikr7 = function(x, y, size,flag){
// hook draw function
if(Math.round(x)==0 && flag==null) {
var n = 1;
(function animate(){
ctx.save();
for(var r=0; r<360; r++){
var x = Math.cos(r*3.14/180 * n) * r/2 + w/2;
var y = Math.sin(r*3.14/180 * n) * r/2 + h/2;
drawikr7(x,y,size,true);
}
ctx.restore();
n+=0.1;
requestAnimationFrame(animate);
})();
//------
} else { // default draw
var ikr7 = new Image();
ikr7.src = './ikr7.png';
ikr7.addEventListener('load', function(){
ctx.drawImage(ikr7, x - size / 2, y - size / 2, size, size);
}, false);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment