diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-06-20 14:12:36 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-06-20 14:12:36 -0400 |
| commit | 1668d6e2e20c9bd53f3f6a299541c582da9742b4 (patch) | |
| tree | c63cd7ff9b13f4b227568131f8a4868e8802b489 /public/assets/javascripts/rectangles/engine/map/_map.js | |
| parent | 3e261676b2f836d272f094e73b0b26c55ef674db (diff) | |
minimap ui
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/map/_map.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/map/_map.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/public/assets/javascripts/rectangles/engine/map/_map.js b/public/assets/javascripts/rectangles/engine/map/_map.js index 0623d05..d5a8442 100644 --- a/public/assets/javascripts/rectangles/engine/map/_map.js +++ b/public/assets/javascripts/rectangles/engine/map/_map.js @@ -9,6 +9,8 @@ var Map = function(opt){ width: window.innerWidth, height: window.innerHeight, zoom: -2, + zoom_min: -6.2, + zoom_max: 0, }) var base = this @@ -32,6 +34,7 @@ var Map = function(opt){ base.set_zoom = function (n) { + n = clamp(n, opt.zoom_min, opt.zoom_max) base.zoom_exponent = n base.zoom = pow(2, n) } @@ -45,14 +48,14 @@ var Map = function(opt){ switch (opt.type) { case "editor": - base.draw = new MapDraw (base) + base.draw = new Map.Draw (base) base.ui = new Map.UI.Editor (base) base.sides = base.sides_for_center $(window).resize(base.resize) break case "minimap": - base.draw = new MapDraw (base, { center: scene.camera }) + base.draw = new Map.Draw (base, { center: scene.camera, minimap: true }) base.ui = new Map.UI.Minimap (base) base.sides = base.sides_for_camera break |
