Closed FormularSumo closed 3 years ago
https://github.com/FormularSumo/Star-Wars-Galaxy-Collection/commit/d77c3591f67a5e3f0bc108c04ac002cf37d95127 Fixed by not running math.floor if on Android Will file a bug report about this different beheaviour between Windows and Android with love.mousemoved(x,y) and love.mouse.getPosition()
Looking into it further, on Windows love.touch returns a float (11 decimal points) while love.mouse returns an integer. On Android both return floats. Using the touchscreen calls love.touch and love.mouse. Left clicking with a mouse calls also calls both. Right or middle clicking a mouse only calls love.mouse, however it still returns a float.
test = 0
test2 = 0
test3 = 0
test4 = 0
test5 = 0
test6 = 0
function love.mousemoved(x,y)
test = x .. ' ' .. y
end
function love.mousepressed(x,y)
test2 = x .. ' ' .. y
end
function love.mousereleased(x,y)
test3 = x .. ' ' .. y
end
function love.touchmoved(id,x,y)
test4 = x .. ' ' .. y
end
function love.touchpressed(id,x,y)
test5 = x .. ' ' .. y
end
function love.touchreleased(id,x,y)
test6 = x .. ' ' .. y
end
function love.draw()
love.graphics.print('love.mouse.getPosition:' .. love.mouse.getX() .. ' ' .. love.mouse.getY())
love.graphics.print('love.mousemoved:' .. test,0,20)
love.graphics.print('love.mousepressed:' .. test2,0,60)
love.graphics.print('love.mousereleased:' .. test3,0,80)
love.graphics.print('love.touchmoved:' .. test4,0,120)
love.graphics.print('love.touchpressed:' .. test5,0,140)
love.graphics.print('love.touchreleased:' .. test6,0,160)
end
Windows: Android:
Problem appears to be that mousex/y aren't rounded on Android but are on Windows