summaryrefslogtreecommitdiff
path: root/client/util.lua
blob: 8a18b9606611d11f6f81d1cd3b7a8bab0c7e07e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local font = love.graphics.getFont()
local text = love.graphics.newText(font)

local function print_good(lines,x,y)
	if type(lines) ~= "table" then lines = {lines} end
	for _,line in ipairs(lines) do
		text:set(line)
		local w,h = text:getDimensions()
		love.graphics.setColor(0,0,0,0.8)
		love.graphics.rectangle("fill",x,y,w,h)
		love.graphics.setColor(1,1,1)
		love.graphics.draw(text,x,y)
		y = y + h
	end
end

return {
	print_good=print_good
}