2024-03-27 03:57:50 +00:00
|
|
|
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)
|
2024-03-24 22:26:07 +00:00
|
|
|
end
|
|
|
|
|
2024-03-27 03:57:50 +00:00
|
|
|
-- todo mousepressed & mousereleased
|
|
|
|
function love.mousepressed(x, y, button, istouch, presses)
|
|
|
|
clock:pressmouse(x, y, button)
|
2024-03-24 22:26:07 +00:00
|
|
|
end
|
|
|
|
|
2024-03-27 03:57:50 +00:00
|
|
|
function love.mousereleased(x, y, button, istouch, presses)
|
|
|
|
clock:releasemouse(button)
|
|
|
|
end
|
2024-03-24 22:26:07 +00:00
|
|
|
|
|
|
|
function love.load()
|
|
|
|
love.graphics.setBackgroundColor(0,0,0)
|
|
|
|
end
|
|
|
|
|
|
|
|
function love.draw()
|
2024-03-27 03:57:50 +00:00
|
|
|
love.graphics.print(clock:getTime():fmt())
|
|
|
|
clock:draw()
|
2024-03-24 22:26:07 +00:00
|
|
|
end
|