I was coding a very small app, that is supposed to randomly generate bingo tables from a given set of numbers. Basically what I want is to render the table to the screen and save the screenshot.
The problem: No screenshot is saved in the directory, setting an identity does not work either. What am I doing wrong?
here's the code:
Code: Select all
function love.load()
numbers = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,25,29,31,36,38,42,45,47,53,55,56,74,78,75,85,86,84,96,93,100}
counter = 1
mul = 30
end
function love.draw()
love.graphics.setBackgroundColor(255,255,255)
love.graphics.setColor(0,0,0)
for y=0, 3 do
for x=0, 3 do
love.graphics.print(numbers[math.random(#numbers)],5+x*mul,10+y*mul)
love.graphics.line(x*mul,y*mul,x*mul+500,y*mul)
love.graphics.line(x*mul,y*mul,x*mul,y*mul+500)
end
end
love.graphics.line(120,0,120,120)
love.graphics.line(0,120,120,120)
s = love.graphics.newScreenshot()
s:encode("Bingo"..counter..".png")
counter = counter+1
end