love.touchreleased() are currently inconsistent in the way they handle
love.touchreleased() start their touch index count from 0, while
love.touch.getTouch() starts from 1. To elaborate:
love.touchpressed(2) will return data for
touchIndex == 2, or while two fingers are touching the screen. Similarly,
love.touchpressed(1) will return data for the (only) single touch.
However, this is how love callback functions work:
function love.touchpressed(id, x, y) if id == 0 then -- single touch doSingleTouchStuff() elseif id == 1 then -- multi touch, a second finger starts touching doMultiTouchStuff() end end
While this is easy to fix, it is causing frustration for those who are not aware of it, especially when documentation is still early and rough.
function love.touchpressed(id, x, y) if id == 0 then returnError() -- invalid touch index, similarly to love.touch.getTouch(0) elseif id == 1 then -- one touch doSingleTouchStuff() elseif id == 2 then -- two touches doMultiTouchStuff() end end
Alternate option would be to consistently starts touch count from 0 (which personally makes less sense to me), but the key point is to maintain consistence across functions.