check post idk what to put in title

  • namename
    12th July Member 0 Permalink

    Android 100.0 Lua question:

    event.mousedown seems to return touchscreen coordinates instead of simulation coordinates. sim.CELL is 4, but the reported (x, y) values jitter even when tapping the same zoomed-in simulation cell. The amount of jitter is the same with and without zoom. Is this expected behavior? Is there a function to convert screen coordinates to simulation coordinates, or is this an Android-specific bug?

  • LBPHacker
    12th July Developer 0 Permalink
    @jacob1 is the one who maintains the Android port but he's on vacation for the foreseeable future.
  • jacob1
    17th July Developer 0 Permalink
    event.mousedown uses simulation coordinates, even on Android. Touchscreen coordinates aren't exposed anywhere in the Lua API, I don't think even the C++ side gets those coordinates.

    The jitter is because everyone has fat fingers, it's really hard to tap in a pixel-perfect position every time.

    When using zoom, there will be a lot of jitter as anything within a 10 pixel radius or so will equate to the same simulation position. But the coordinates in the event will be without the zoom window applied, and you can use sim.adjustCoords to account for the zoom window.
  • KyleTheCreator
    17th July Member 0 Permalink

    @jacob1 (View Post)

     I have raccoon fingers/laser fingers  :D

    Edited once by KyleTheCreator. Last: 17th July
  • jacob1
    17th July Developer 0 Permalink
    @KyleTheCreator (View Post)
    Mine are fat ): , although hmm they might be shrinking slightly.

    Made it really hard to tap precisely for the test. But it's definitely not touchscreen coordinates since it was using tpt's resolution and not my phone's resolution (probably 1080p or higher)
  • pacmanfan123
    17th July Member 0 Permalink

    @jacob1 (View Post)

     X buttons on mobile ads are the reason why mobile pens exist; people are out of control, taking advantage of large fingers!