How can I get the test play screen to start up faster when I include images over 10000px?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CharlieMalphas

The title says it all. When I do a test play when I put in an image with either a vertical width or a width of 10000px, it takes a lot of time to start up. I changed that image from PNG to WebP but the result did not change. How can we solve this kind of problem?


:bust_in_silhouette: Reply From: zhyrin

When you “include” the image in the screen, it needs to be loaded from disk which can take a lot of time (especially with images that big).
What you could do is instead just have the resource path to your image. When the screen needs to be shown, you can start loading in the image in a separate thread and only add it to the screen when it’s loaded.
Alternatively you can try to anticipate when the screen will be required and start loading the image beforehand (again the key is to do it on a separate thread).