Hi all,
I’ve found a weird touch bug in the simulator, at least on my MacBook Pro running OSX Mojave.
Try this simple script below in a clean main.lua and see if you have it too, if you like. The bug or weirdness is the following:
-
click and hold the screen clicked
-
each time a touch event is detected the counter adds 1
-
I get about 160 “moved” touch events, just clicking in one spot and holding still. Then the counter sort of stops, unless I move my touch point around.
So in short, at first I get a steady stream of events for no particular reason, and then it trickles to a halt… Anybody else have this in their simulator?
I’m having extra issues with touch regarding rounding of the event.x and event.y values that I will share later in this post, but first I’d like to see if others can replicate this issue, or if it’s specific to my setup. ( but I can already tell you that this rounding issue causes trouble with detection of touch move speed ).
thanks,
Thomas
local self = {} self.touchCounter = 0 self.touchCounterText = display.newText(self.touchCounter, 200,200, system.nativeFont, 96) self.touchCounterText.anchorX = 0 self.screenTouched = function(event) self.touchCounter = self.touchCounter + 1 self.touchCounterText.text = self.touchCounter.." "..event.phase end Runtime:addEventListener("touch", self.screenTouched)