Animating while an image loads (multithreading)

J

JouzuJones

Guest
Hello.

I am working on a loading screen to give users something to look at while images are loading into my game, and I would like to make the loading screen a little more interesting to look at.

I understand how to create a loading bar that updates between every image that is loaded into the game, but I have no clue how to allow animations to continue while an image is loading.

does anyone know how I can do this?
 
D

Deleted member 467

Guest
Before I can understand what you are fully asking, let me ask questions

What are the animations you are referring to? The bar? Objects being loaded in the game? The background of the load screen?
 

M. Idrees

Member
Use draw Event to make a loading screen like :

if loading == true
draw a rectangle and increase its width every step by 1 and when it reached the max_size then set
loading = false and show_message images are loaded successfully.
or you can use sprite with draw_sprite_stretched.
 
J

JouzuJones

Guest
Before I can understand what you are fully asking, let me ask questions

What are the animations you are referring to? The bar? Objects being loaded in the game? The background of the load screen?
essentially what I'm asking about here is some sort of multithreading. I would like to have images loading in on their own thread so other simple calculations and animations can continue in the meantime.
 
D

Deleted member 467

Guest
I don't think so but I don't think I'm qualified to answer that question.
 
E

elementbound

Guest
Gave it some testing. As the documentation says, background_add won't block if you are loading from a URL ( aka. it needs to be downloaded from the internet ). Tried it with a file:// URL instead, does not work at all.
The documentation also says that if you are using it with the HTML5 module, it will always be async.

So far I haven't seen any methods to load local images without blocking. My only solution would be to write some non-blocking image loading code yourself, but that could be exponentially slower. So either this, or a DLL.
 
Top