RMMZ 1.8.1
Hello.
It's possible to cache images before displaying them, which is very useful for animations (when you don't want to go the video format route). Naturally I can optimize the images as much as possible, as well as use layers so the animation is not changing unnecessary details like backgrounds etc. However, that still leaves the last part: decoding.
Caching the images helps a lot (i.e. ImageManager.loadPicture()), but there is still a delay when you rapidly "show" cached images for an animation due to the decoding required before display, which will become more and more significant the more frames you're trying to display at once—and it'll also slow down the worse the hardware is.
To be clear, this is on the first display of the images. If the animation is repeated after the first display, it is played perfectly because the images are decoded and ready to repeat. But the first display (that the user sees) is what's important, and it is possible it may only be played the one time even if you could live with the initial laggy/image-skipping display.
I would like to mitigate that as much as possible by both caching and decoding the images before display. It is possible to sort of do that if you display the image on the canvas, and hide it under another layer or similar, but that's not always viable. It is also extremely cumbersome. I had no luck getting it to decode an image unless it was actually drawn to the canvas (so no displaying at 0 alpha etc.) although I must admit that testing of mine was done a while ago.
I was wondering if it's possible to tell it to decode a series of images, similar to how I can just give it a little loop of images to cache? And if that's sadly not possible, if there are any code workarounds, is it possible to make it decode the image when displayed despite it being initially shown completely invisible (whereas usually it would not decode presumably because it's not actually being drawn on the canvas)?
I'd appreciate any help!
Hello.
It's possible to cache images before displaying them, which is very useful for animations (when you don't want to go the video format route). Naturally I can optimize the images as much as possible, as well as use layers so the animation is not changing unnecessary details like backgrounds etc. However, that still leaves the last part: decoding.
Caching the images helps a lot (i.e. ImageManager.loadPicture()), but there is still a delay when you rapidly "show" cached images for an animation due to the decoding required before display, which will become more and more significant the more frames you're trying to display at once—and it'll also slow down the worse the hardware is.
To be clear, this is on the first display of the images. If the animation is repeated after the first display, it is played perfectly because the images are decoded and ready to repeat. But the first display (that the user sees) is what's important, and it is possible it may only be played the one time even if you could live with the initial laggy/image-skipping display.
I would like to mitigate that as much as possible by both caching and decoding the images before display. It is possible to sort of do that if you display the image on the canvas, and hide it under another layer or similar, but that's not always viable. It is also extremely cumbersome. I had no luck getting it to decode an image unless it was actually drawn to the canvas (so no displaying at 0 alpha etc.) although I must admit that testing of mine was done a while ago.
I was wondering if it's possible to tell it to decode a series of images, similar to how I can just give it a little loop of images to cache? And if that's sadly not possible, if there are any code workarounds, is it possible to make it decode the image when displayed despite it being initially shown completely invisible (whereas usually it would not decode presumably because it's not actually being drawn on the canvas)?
I'd appreciate any help!