diff options
Diffstat (limited to 'src/objs/tilemap.lua')
| -rw-r--r-- | src/objs/tilemap.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/objs/tilemap.lua b/src/objs/tilemap.lua index 834a770..90b8c8a 100644 --- a/src/objs/tilemap.lua +++ b/src/objs/tilemap.lua @@ -153,6 +153,11 @@ function to_tile_coords(x, y) return math.floor(x / TILESIZE), math.floor(y / TILESIZE) end +function get_tile_rect(x, y) + x, y = to_tile_coords(x, y) + return x*TILESIZE, y*TILESIZE, TILESIZE, TILESIZE +end + function remove_tile(map, x, y) map.tiledata[ID(map, x, y)] = 0 map.needs_rebuild = true |
