Controller works quite well now

This commit is contained in:
2024-07-20 20:18:01 +02:00
parent 3eee21480b
commit 6d147ee5d0
4 changed files with 80 additions and 46 deletions

View File

@@ -45,8 +45,8 @@ function love.draw(...)
local centerY = love.graphics.getHeight() / 2
-- Calculate textX and textY
--local textX = math.floor(centerX - (font:getWidth(text) / 2))
--local textY = math.floor(centerY - (font:getHeight(text) / 2))
local textX = math.floor(centerX - (font:getWidth(text) / 2))
local textY = math.floor(centerY - (font:getHeight(text) / 2))
local textX, textY = 10, 10
local realText
@@ -77,6 +77,15 @@ function love.update(...)
end
end
function love.gamepadpressed(joystick, button)
if button == "guide" then
love.event.quit()
end
if love.gamepadpressed2 then
safeCall(love.gamepadpressed2, joystick, button)
end
end
function love.mqtt.onError(message)
print("MQTT error: " .. message)
end