Answer the question
In order to leave comments, you need to log in
How to understand this behavior of LibGDX?
I am writing a game for mobile devices in Java with the libgdx framework. After passing, the screen changes and when the player clicks on the "Next Level" button, the inscription loading the level is first displayed, then the level is loaded and then it starts. That is,
drawing();
loadLevel();
setScreen();
In fact, the level is loaded first (loadLevel()), then the inscription pops up for a moment and the level begins. No matter how I tried to change the algorithm, the level is loaded first (it looks like everything is hanging).
Switched to Java recently from JavaScript, what am I missing?
Answer the question
In order to leave comments, you need to log in
Learn the concept of "message loop". Between drawing() and loadLevel() force the processing of window messages.
As far as I understand (I don’t know the framework), Display.processMessages();
No, it's just calling the functions one by one. I have a message so far just in the form of a changing picture. Like "click" - "level is loading"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question