Browse Source

expose pixl.area for calculating the visible area.

Lucas Stadler 12 years ago
parent
commit
d482041e17
1 changed files with 4 additions and 0 deletions
  1. 4 0
      js/pixl/public/index.html

+ 4 - 0
js/pixl/public/index.html

@ -78,6 +78,10 @@
78 78
					y: pixl.window.h / 2 + (world_pos.y - pixl.pos.y) * pixl.size};
79 79
		}
80 80
81
        pixl.area = {};
82
        pixl.area.w2 = function() { return Math.round(pixl.window.w / pixl.size / 2); };
83
        pixl.area.h2 = function() { return Math.round(pixl.window.h / pixl.size / 2); };
84
81 85
		pixl.at = function(pos) {
82 86
			var p = pixl.world[pos.x + "," + pos.y];
83 87
			return p !== undefined && p.color !== "white";