local bump = require 'bump' local bump_debug = {} local function getCellRect(world, cx,cy) local cellSize = world.cellSize local l,t = world:toWorld(cx,cy) return l,t,cellSize,cellSize end function bump_debug.draw(world) local cellSize = world.cellSize -- local font = love.graphics.getFont() local fontHeight = 20 local topOffset = (cellSize - fontHeight) / 2 for cy, row in pairs(world.rows) do for cx, cell in pairs(row) do local l,t,w,h = getCellRect(world, cx,cy) local intensity = cell.itemCount * 12 + 16 jin.graphics.setColor(255,255,255,intensity) jin.graphics.rect('fill', l,t,w,h) jin.graphics.setColor(255,255,255, 64) -- jin.graphics.printf(cell.itemCount, l, t+topOffset, cellSize, 'center') jin.graphics.setColor(255,255,255,10) jin.graphics.rect('line', l,t,w,h) end end end return bump_debug