summaryrefslogtreecommitdiff
path: root/print_good.lua
blob: f348a30b0ccca232306cc9f59fdd0ecc50e210fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local font = love.graphics.newFont(18)
local text = love.graphics.newText(font)

local function print_good(str,x,y,othrfont,nob)
	love.graphics.push()
	love.graphics.origin()
	text:setFont(othrfont or font)
	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
	if x == "end" then  x = W-w end
	if y == "end" then  y = H-h end
	love.graphics.setColor(0,0,0,0.8)
	if not nob then love.graphics.rectangle("fill",x,y,w,h) end
	love.graphics.setColor(not nob and {1,1,1} or {0,0,0})
	love.graphics.draw(text,x,y)
	love.graphics.pop()
end

return print_good