Async image loading with mojo2
Monkey Forums/Monkey Programming/Async image loading with mojo2
| ||
I checked the documentation and the forums and what I understand is that async image loading basically works only for mojo1 images, is that so? If yes, has anyone managed to implement async image loading across all targets with mojo2 images? I was thinking about creating a loader class where queued assets would be loaded once at a time synchronously, then delaying the loading of the next item in the queue until the next frame, but was hoping for a cleaner and non-blocking solution. |
| ||
Find a solution? |
| ||
Nope, I didn't want to waste too much time on it. I ended up implementing a loading queue and updating the gui the frame after every rrsource loaded. Works ok for a loading screen, but it's extremely limited anyway. |
| ||
Anyone willing to do work to make Mojo2 work with the async image loading as a paid commission? If not I'll do it myself as soon as I have time and post the changes. |
| ||
I actually added this to 'regal.mojoinmojo2' last year. Here's the relevant code. When the operation finishes, it constructs an image like this; in other words, it uses 'Image.WritePixels'. |
| ||
I decided to say screw it, and I wrote a demo. That should do exactly what you're looking for. |
| ||
Awesome! I'll take a look soon and report results. |
| ||
Think I forgot to report that it worked great. I was loading all JPEGs until now. It seems images with transparent backgrounds do not load right? |
| ||
Okay, this should be fixed now. Download the latest version from GitHub. |
| ||
Awesome! Works! Thank you! |