Skip to content

Instantly share code, notes, and snippets.

@marcelaraujo
Created May 21, 2014 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelaraujo/d0ca07ca0e0fbe8a7e07 to your computer and use it in GitHub Desktop.
Save marcelaraujo/d0ca07ca0e0fbe8a7e07 to your computer and use it in GitHub Desktop.
canvas draw
var $this = element; //cache
(function loop() {
if (!$this.paused && !$this.ended) {
context.drawImage($this, 0, 0);
setTimeout(loop, 16.67); // drawing at 30fps
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment