summaryrefslogtreecommitdiff
path: root/client/util.lua
blob: a1c4b3584bd3421f012bf7ace2ad8909378f72c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local font = love.graphics.getFont()
local text = love.graphics.newText(font)

local function print_good(str,x,y)
	text:set(str)
	local w,h = text:getDimensions()
	local W,H = love.graphics.getDimensions()
	if x == "center" then x = (W/2)-(w/2) end
	if y == "center" then y = (H/2)-(h/2) end
	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)
end

local tile_names = {
	'red',
	'orange',
	'yellow',
	'green',
	'teal',
	'blue',
	'purple',
	'grey',
	'ubqorange',
}

return {
	print_good=print_good,
	tile_names=tile_names,
}