Created
September 17, 2012 23:03
-
-
Save tlhunter/3740310 to your computer and use it in GitHub Desktop.
Cobalt Calibur Tile Drawing
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
drawTile: function(x, y, tile) { | |
var x_pixel = x * app.graphics.TILE_WIDTH_PIXEL; | |
var y_pixel = y * app.graphics.TILE_HEIGHT_PIXEL; | |
if (tile == null || isNaN(tile[0])) { | |
return; | |
} | |
app.graphics.handle.drawImage( | |
app.graphics.tilesets.terrain, | |
0, | |
tile[0] * app.graphics.TILE_HEIGHT_PIXEL, | |
app.graphics.TILE_WIDTH_PIXEL, | |
app.graphics.TILE_HEIGHT_PIXEL, | |
x_pixel, | |
y_pixel, | |
app.graphics.TILE_WIDTH_PIXEL, | |
app.graphics.TILE_HEIGHT_PIXEL | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment