From 23f4ba5eac849c0fd0960ec84b89fa5809f16c99 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 7 Aug 2012 01:33:39 +0200 Subject: [PATCH] Add GetRangePosition function for determining base points for tile ranges --- map_isometric.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/map_isometric.js b/map_isometric.js index b37041a..ea9ad12 100644 --- a/map_isometric.js +++ b/map_isometric.js @@ -202,6 +202,14 @@ if(RadiumEngine !== undefined) return origin.Add(new RadiumEngine.Point(0 - (this.tile_width / 2), 0)); } + this.GetRangePosition = function(start, size) + { + x = this.GetTilePosition(start.x, start.y + size.y).x; + y = this.GetTilePosition(start.x, start.y).y; + + return new RadiumEngine.Point(x, y); + } + this.TileFromPosition = function(x, y) { p = new RadiumEngine.Point(x, y);