Weird bug ?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
PGUp
Party member
Posts: 105
Joined: Fri Apr 21, 2017 9:17 am

Weird bug ?

Post by PGUp »

Code: Select all

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
Image

testing out löve for Android, and found this weird bug? It should be displaying lines only
Attachments
Screenshot_20180128-162516.png
Screenshot_20180128-162516.png (208.19 KiB) Viewed 1989 times
-
User avatar
jojomickymack
Prole
Posts: 45
Joined: Tue Dec 26, 2017 4:52 pm

Re: Weird bug ?

Post by jojomickymack »

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
Screenshot_20180129-183453.png (47.17 KiB) Viewed 1935 times
PGUp
Party member
Posts: 105
Joined: Fri Apr 21, 2017 9:17 am

Re: Weird bug ?

Post by PGUp »

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..
-
Post Reply

Who is online

Users browsing this forum: No registered users and 202 guests