So one of the ongoing commissions I have at the moment is a menu overhaul for a game, and it involves a lot of visual elements for window backgrounds, face frames made up of several separate images, several possible images that represent different command selection states etc.
The way I did it initially was that for anything where it was created as a new sprite, I just set the bitmap directly because that handles the loading automatically and there's no issue with displaying it. But for doing a block transfer from a source to a destination bitmap, it needs to be preloaded otherwise it won't show up the first time the scene is accessed. For those, I added load listeners to the bitmaps to ensure that processing only continued when they finished loading.
I'm working on refactoring finished menu plugins at the moment, and as part of that one idea I've had is to add an image loading function that iterates through all the image filenames needed for the menu in its start function and adds a load listener where it loads the next one.
However, the client has asked that I go with "the standard way" of doing this. So for those with experience or knowledge of custom scenes that use a lot of images, how do you handle loading them?
The way I did it initially was that for anything where it was created as a new sprite, I just set the bitmap directly because that handles the loading automatically and there's no issue with displaying it. But for doing a block transfer from a source to a destination bitmap, it needs to be preloaded otherwise it won't show up the first time the scene is accessed. For those, I added load listeners to the bitmaps to ensure that processing only continued when they finished loading.
I'm working on refactoring finished menu plugins at the moment, and as part of that one idea I've had is to add an image loading function that iterates through all the image filenames needed for the menu in its start function and adds a load listener where it loads the next one.
However, the client has asked that I go with "the standard way" of doing this. So for those with experience or knowledge of custom scenes that use a lot of images, how do you handle loading them?