I found this piece of code somewhere on the forum, but did not quite understand how it works:
it already works and reads screen clicks or is it just functions that I have to call directly in the update section
in this case, I do not understand how to call these functions
Code: Select all
local touches = {}
function love.touchpressed(id, x, y)
touches[id] = {x, y}
end
function love.touchmoved(id, x, y)
touches[id][1] = x
touches[id][2] = y
end
function love.touchreleased(id, x, y)
touches[id] = nil
end
function howManyTouches()
return #touches
end
Code: Select all
local zxc = howManyTouches()
if zxc>0
then
touched=true
else
touched=false
end
before that I worked only on a game maker, I did not think about such things there xD
sorry for my bad english btw, its not my main language