Touch xy seem to be duplicated under heavy load #3849
Replies: 1 comment
-
Posted at 2022-01-14 by momo And as I don't want to open another thread but also couldn't find good references: Are there some general tips on how to optimize the performance while programming for the Bangle.js 2? In my game I'm drawing a bunch of shapes - quite rapidly. Posted at 2022-01-17 by @gfwilliams Interesting - thanks! As I understand it the last touch position is stored, but if something is taking a long time to draw previous positions will be left. It's sort of intentional as for things like scrolling, you want to redraw as fast as you can but you don't want to queue up redraws for previous scroll events. Honestly, I feel like if your game is taking so long to render a frame that this is an issue, that might itself impact the playability of the game? There are some hints for speed on http://www.espruino.com/Performance that might help you I guess? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-01-14 by momo
Hi all, I noticed that under heavy load, the touch event gets fired appropriately, however the xy coordinates are sometimes wrong (to be precise: they are a duplicate of the previous touch event).
Trying out this code
and then quickly touching the screen, alternating between the upper edge and lower edge, does register the correct amount of events, however a quick top, bottom, top tap results in this console log
It doesn't reproduce every single time, however it happens often. Any idea how this could be fixed?
Thank you
~momo
Beta Was this translation helpful? Give feedback.
All reactions