function touch()
t = lt.getTouches()
if #t < 2 then
for i,v in pairs(t) do
ix, iy = lt.getPosition(v)
end
end
end
function touched()
t = lt.getTouches()
if #t > 0 then
return true
end
end
function love.load()
lg = love.graphics
lt = love.touch
lg.setBackgroundColor(255,255,255)
ix = 0
iy = 0
pos = {}
end
function love.update()
if touched() then
touch()
table.insert(pos, ix)
table.insert(pos, iy)
end
end
function love.draw()
lg.setColor(0,0,0)
if #pos > 3 then
lg.line(pos)
end
end
testing out löve for Android, and found this weird bug? It should be displaying lines only
Attachments
Screenshot_20180128-162516.png (208.19 KiB) Viewed 1989 times
Hey, I ran this on Android and I just see the line appear where I touch, like you described, no black sections leading to the corner like in the screenshot.
Seems to work fine for me on Moto g5 when run using love2d app. What device are you using?
Actually, I do see one spaz line going off, nothing like what you showed though. Maybe adding some numbers in the corner to show the lowest value recorded for the touchpoints would help? From you code it seems impossible for it to be 0 or 3.
his screenshot from the app looked much smoother before I reduced the resolution to save some bytes on the server, you can see my stray line zinging off to the corner though.
Screenshot_20180129-183453.png (47.17 KiB) Viewed 1935 times
jojomickymack wrote: ↑Tue Jan 30, 2018 1:20 am
Hey, I ran this on Android and I just see the line appear where I touch, like you described, no black sections leading to the corner like in the screenshot.
Seems to work fine for me on Moto g5 when run using love2d app. What device are you using?
Actually, I do see one spaz line going off, nothing like what you showed though. Maybe adding some numbers in the corner to show the lowest value recorded for the touchpoints would help? From you code it seems impossible for it to be 0 or 3.
his screenshot from the app looked much smoother before I reduced the resolution to save some bytes on the server, you can see my stray line zinging off to the corner though.
Screenshot_20180129-183453.png
Yeah, seems like it's only on my device, when I did the same thing using .apk file export it works fine..