I can't really find a good answer to this anywhere, I have never worked on games in a proffessional environment and I am wondering; Do these games render their UI in the main game-loop?
That is, do they render loading-screen, menu-screen, text-dialogs with running text, ingame UI (direction arrows for example) in the main game loop? that is the same game-loop they use to update and render the actual game-play, meaning only one activity is used, and the game-loop runs from the moment the app starts until it exits.
I'm having a hard time making my menu because I want to animate the buttons, but when I have the menu in my main game-loop and I for example press the "start game"-button, the game starts right away before the buttons animation is played (supposed to shrink), is this just done adding like a timer for delay or something like that (like in example below)? Feels so ugly.
Ugly pseudo code:
if(startButton gets pressed){
start button animation;
start 1 second timer;
timer finished -> start game;
}
EDIT: I'm building my game for ios and Android using LibGdx Java, but I guess this question is universal so that might not be relevent.
running
andpaused
atm. Since each "screen" (game, menu, level-selector) handles it's own rendering I dont really need any more states. I guess you could say I use several screens instead of several game states, I just find that this way my code is much cleaner. \$\endgroup\$