A test code:
function love.update(dt)
print(love.mouse.getPosition())
x,y=love.mouse.getPosition()
x=x+10
love.mouse.setPosition(x, y)
print(x,y,love.mouse.getPosition())
end
Some of my output:
73 209
83 209 73 209 (x,y doesn't match getpostion in most cases)
83 209
93 209 83 209
83 209 (the cursor stayed on x=83 for two frames)
93 209 83 209
93 209
103 209 93 209
93 209
103 209 103 209 (x,y match getpostion in rare cases, it seems that getpostion is not simply delayed for one frame)
103 209
113 209 103 209
113 209
123 209 113 209
123 209
133 209 123 209
123 209
133 209 123 209
133 209
143 209 133 209
133 209
143 209 133 209
133 209 (133 lasts four frames)
143 209 133 209
143 209
153 209 143 209
(My system is windows 10.)
love.mouse.setposition seems to have a random delay
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
love.mouse.setposition seems to have a random delay
Last edited by artless on Wed Aug 12, 2020 6:01 am, edited 1 time in total.
Re: love.mouse.setposition seems to have a random delay
Works fine for me on X11. What's your windowing system? If it's not X11, it's probably the windowing system's fault.
Code: Select all
0 0
10 0 10 0
10 0
20 0 20 0
20 0
30 0 30 0
30 0
40 0 40 0
40 0
50 0 50 0
50 0
60 0 60 0
60 0
70 0 70 0
70 0
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests