System.touchImages

Function/Meaning

Loading images into cache

Type
Systemclassmethod of
Syntax
touchImages(storages, limitbytes=0, timeout=0)
Arguments
storages

Pass the image storage name you want to cache as an array (Object of Array class).
The one written earlier has priority.
Kirikiri manages the cache using the character string specified in the first argument of Layer.loadImages as a key, so to make the cache meaningful, the image storage name specified here is Layer.loadImages. Must be the same as the one specified in the first argument of.

limitbytes

Specifies the cache capacity limit to use in calling this method, in bytes.
Specify 0 to use all cache. If you specify a positive number, it will try to use the cache up to that number of bytes.
If you specify a negative number, the current cache limit (System.graphicCacheLimit) plus that number (but actually subtracted because it adds a "negative number") is used as the limit.
If the result is a limit of 0 or negative, this method exits without doing anything.
For example, if you specify -2 * 1024 * 1024, he is considered to have specified the current cache limit minus 2MB.
This is useful if you want to leave some room in the cache.

timeout

Specifies the timeout (time limit) in ms. If you specify 0, there is no limit.
This method will stop loading subsequent images and return after the time specified by this argument has elapsed.
However, if a timeout occurs while loading an image, it will not return until the image has finished loading.

Return value
None (void)
Explanation

This method attempts to cache the specified image.
However, while this method attempts to cache the image, there is no guarantee that the image will actually be cached.
If the image cache limit is exceeded or a timeout occurs, image loading will be interrupted.
The image specified in the storages argument is more likely to be cached (priority is given) as it is written first.
If the specified image is already in the cache, it just raises the rank of survival in the cache.
This method ignores any errors during image loading.
In the current version, the images that can be cached with this method are usually images that can be loaded by Layer.loadImages and do not specify a color key (images with an alpha channel are fine).
Universal transition rule images and area images will be read, but they will not be valid data as a cache (the read data will be wasted), so do not specify them.
See System.graphicCacheLimit for the number of bytes an image uses in the cache.