Created
December 30, 2011 17:35
-
-
Save anonymous/1540718 to your computer and use it in GitHub Desktop.
codazoda - pastebin.com/iSQYG4DY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the Iso class | |
function Iso() { | |
// Public Properties | |
this.canvas = ''; | |
this.context = ''; | |
} | |
Iso.prototype.init = function(div) { | |
this.canvas = document.getElementById(div); | |
this.context = this.canvas.getContext('2d'); | |
} | |
Iso.prototype.draw = function (x, y, z, file) { | |
// Load the image tile | |
var imageTile = new Image(); | |
imageTile.src = file; | |
// Calculate the position | |
var calcX = x; | |
var calcY = y; | |
// Draw the image tile | |
this.context.drawImage(imageTile, calcX, calcY); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment