26 lines
666 B
Lua
26 lines
666 B
Lua
local Clock = require"clock"
|
|
local clockTransform = love.math.newTransform(love.graphics.getWidth()/2, love.graphics.getHeight()/2)
|
|
local clock = Clock:new(nil, 400, clockTransform)
|
|
|
|
function love.mousemoved(x, y, dx, dy, istouch)
|
|
clock:movemouse(x, y)
|
|
end
|
|
|
|
-- todo mousepressed & mousereleased
|
|
function love.mousepressed(x, y, button, istouch, presses)
|
|
clock:pressmouse(x, y, button)
|
|
end
|
|
|
|
function love.mousereleased(x, y, button, istouch, presses)
|
|
clock:releasemouse(button)
|
|
end
|
|
|
|
function love.load()
|
|
love.graphics.setBackgroundColor(0,0,0)
|
|
end
|
|
|
|
function love.draw()
|
|
love.graphics.print(clock:getTime():fmt())
|
|
clock:draw()
|
|
end
|