2
\$\begingroup\$

We're developing a game, we want to perform actions the moment the user touches the screen, delays make the game impossible to play.

We're testing on samsung S3 mini and samsung a5, we know they are low end devices and lags are to be expected. But How accurate is Gdx.input.justTouch()? Is it so accurate on high end phones?

  • If not then how to improve the accuracy?
  • Is the same problem expected from keyboard or mouse input if we publish a webapp version?
\$\endgroup\$
1
  • \$\begingroup\$ I believe each update it gets processed. In this case lower frame rate means less accuracy, but since you can only draw as fast as your update loop it should not matter afaik. \$\endgroup\$
    – Madmenyo
    Feb 2, 2017 at 15:30

1 Answer 1

2
\$\begingroup\$

Input.justTouched() returns true if an event has occurred between the current frame and the previous. That means it's as accurate (or indeed as in-accurate) as the frame rate.

Two separate calls to justTouched made during one render call on the ApplicationListener will always return the same value.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .