In main.lua i call a function from a separate .lua file (in a separate folder within the project files).
That function is a for loop that generates a hexagonal map. Any map size over 500 total hexagons takes a recognizable time (and when its over 5000 it takes around 7 seconds). To fill this gap, I thought I like to have a progress bar, or even just a ‘loading’ text.
When a button in the menu is pressed, a function is called that deletes all the current UI on the screen then immediately calls that map generation function (a table of the map hexagons is returned). Weird thing is, even though it takes several seconds, the current UI is not deleted until the map shows up. The map shows up as a whole, instead of what i was expecting which was 1 by 1 hexagons being added. I was expecting to at least see the removal of the menu and maybe a blank screen until the whole map pops up. But no, the menu stays up for the duration then 100% of the map shows up.
Does this have to do with a separate .lua file? Does this have anything to do with returning a table? I am kind of confused. I obviously have tried to add just a loading screen but again, its just the menu and then immediately the map.