Skip to content

Instantly share code, notes, and snippets.

@caubry
Last active January 3, 2016 12:38
Show Gist options
  • Save caubry/8463795 to your computer and use it in GitHub Desktop.
Save caubry/8463795 to your computer and use it in GitHub Desktop.
var img = new Image();
setup = function() {
var body = document.getElementById('body');
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
body.appendChild(canvas);
img.onload = onImageLoad;
img.src = "/media/img/gamedev/ralphyrobot.png";
body.appendChild(img);
};
onImageLoad = function(){
console.log("Image Loaded");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment