From 97d2fc1f3cef3c02fee36e416a8f2b5205940be2 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Thu, 12 Mar 2026 17:00:24 -0400 Subject: show the tileset you're using --- src/objs/tilemap.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/objs/tilemap.lua') diff --git a/src/objs/tilemap.lua b/src/objs/tilemap.lua index 8b1ab76..f1cdd15 100644 --- a/src/objs/tilemap.lua +++ b/src/objs/tilemap.lua @@ -107,7 +107,7 @@ function rebuild_tilemap(map) end end -local TILE_TEX = get_tex("res/img/tilesets.png") +TILE_TEX = get_tex("res/img/tilesets.png") local TILE_QUAD = lg.newQuad( 0, 0, TILESIZE, TILESIZE, @@ -150,3 +150,12 @@ function remove_tile(map, x, y) map.tiledata[ID(map, x, y)] = 0 map.needs_rebuild = true end + +function get_tileset_quad(tileset) + local start_y = (tileset - 1) * 4 * TILESIZE + return lg.newQuad( + 0, start_y, + 4 * TILESIZE, 4 * TILESIZE, + TILE_TEX:getDimensions() + ) +end -- cgit v1.3-2-g0d8e