sum-grid.love/0023-draw_cell

17 lines
434 B
Plaintext

draw_cell = function(n, x,y, draw_cursor, fixed)
local s = tostring(n)
local w = App.width(s)
local px = (Square_side-w)/2
if fixed then
App.color{r=0, g=0, b=0}
else
App.color{r=0.4, g=0.4, b=0.4}
end
love.graphics.print(s, x+px, y+Padding)
if draw_cursor then
if math.floor(Cursor_time)%2 == 0 then -- blink
App.color(Cursor_color)
love.graphics.rectangle('fill', x+px+w, y+15, 3, Square_side-20)
end
end
end