diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-04-18 14:42:01 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-04-18 14:42:01 -0400 |
| commit | c780419e05bddf80b09e3091634361f289666f35 (patch) | |
| tree | 0c3da34fbb443938672d92aaed22b1639345ca54 /assets/javascripts/rectangles/map/draw.js | |
| parent | b67e1e3c83e06fe7b5dfa4fa75f714121c02ce50 (diff) | |
camera cursor
Diffstat (limited to 'assets/javascripts/rectangles/map/draw.js')
| -rw-r--r-- | assets/javascripts/rectangles/map/draw.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/assets/javascripts/rectangles/map/draw.js b/assets/javascripts/rectangles/map/draw.js index 1dcd1ae..1fca4b9 100644 --- a/assets/javascripts/rectangles/map/draw.js +++ b/assets/javascripts/rectangles/map/draw.js @@ -44,6 +44,29 @@ map.draw = new function(){ } } } + + base.camera = function(cam){ + ctx.lineWidth = 0.5 + + ctx.save() + + ctx.translate(cam.x, cam.z) + ctx.rotate(cam.rotationY) + + var radius = 3 / map.zoom + + ctx.fillStyle = '#888'; + + ctx.beginPath(); + ctx.moveTo(0,0) + ctx.lineTo(-radius,-radius/2) + ctx.lineTo(0,radius*3) + ctx.lineTo(radius,-radius/2) + ctx.moveTo(0,0) + ctx.fill() + + ctx.restore() + } // |
