If you want show something rather than plain text on loading screen, separate it from main bloated atlas and load it first before anything else. Make sure it is light so you can load it from loading screen's constructor. After the manager done, process to your game.

Thank you, but I don't really want to use the AssetManager, as I do not care about asynchronous loading or reference counting. I have my own class for texture keeping, which probably wasn't very smart but whatever.

Is there no other way to update the display in libGdx during create()?

I could do that, but then I'd have to have that code in the render() function of libGdx, which does work, sure, but it looks a bit strange in my opinion to have a "load-something" function as part of the render()-function of libgdx.

I might just be picky here tho, and this is the way to go about it seeing as libGdx doesn't provide a function to just present the screen or update the display (as lwjgl does)

Thank you, but I don't really want to use the AssetManager, as I do not care about asynchronous loading or reference counting. I have my own class for texture keeping, which probably wasn't very smart but whatever.

Is there no other way to update the display in libGdx during create()?

AssetManager is how you do it. This allows you to render while your resources are loaded on a separate thread. Otherwise I guess you could load minimal stuff in create, render a frame, then load the rest.

Yeah the problem is, that it isn't just textures or sounds or other resources that I need to load. I have a rather long (and bad) map-creation code and I just wanted to display a text like "loading" before creating the map.

Using the AssetManager does not solve OP's problem. It's even completely unrelated to a 'map generation process', so I'm not sure why it's being brought up here repeatedly.

Basically you need to call the render loop at least twice to do this: once to render the loading screen, once to also do the map generating and other time-intensive stuff. For example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14

privatebooleanrendered = false;

publicvoidrender() {if (!rendered){// Do nothing for one update to make sure something has been renderedrendered = true; } else {// Now that we had at least one render finished, do some time-intensive stuffmap.init(); }sb.begin();bmf.draw(sb, "Loading", 100, 100);sb.end();}

Edit: in other words, you cannot do this in create().

This is the price you pay for getting multiplatform compatibility I think.

Thank you, that is how I solved it too currently. I just think it's not very sexy to have a function that loads(/generates) stuff inside the render() function.

I think it just depends on how you look at it: it's not terribly sexy either to render stuff inside the create() function I treat the LibGDX render() function as an updateAndRender() function, which it basically is. Anyway, glad you solved it!

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org