2
\$\begingroup\$

The delta value given to the render method in the Screen class is a non-constant number. What is it? Where does it come from? Does it differ by screen size?

\$\endgroup\$
3
\$\begingroup\$

The delta time is the time elapsed since rendering the last frame.

Since the optimal number of frames rendered by the GPU is roughly 60 frames per second (the optimal frame rate for games), then, in normal conditions, when the game does not have any performance issues, then the delta time will roughly be equal to 1/60.

Simply googling for "libgdx delta" produces various results, the first of which is a link to the Screen interface API, which has javadoc description for the public void render(float delta) method.

Here it is:

void render(float delta)
Called when the screen should render itself.
Parameters:
  delta - The time in seconds since the last render.

Hope this helps. Just also remember that Google is your first best friend in situations when you don't understand stuff ;).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.