System.touchImages

Function/Meaning
Loading images into cache
Type
System class method
Syntax
touchImages(storages, limitbytes=0, timeout=0)
Arguments
storages Pass the image storage names you want to put into the cache as an array (Array class object).
Items listed earlier have higher priority.
Since KiriKiri manages the cache using the exact string specified in the first argument of Layer.loadImages as the key, the image storage names specified here must be identical to those passed as the first argument to Layer.loadImages for the cache to be effective.
limitbytes Specifies the cache capacity limit to be used by this method call, in bytes.
If 0 is specified, the entire cache is used.
If a positive number is specified, it attempts to use the cache up to that number of bytes.
If a negative number is specified, the value added to the current cache limit ( System.graphicCacheLimit ) is used as the limit (however, since a negative number is added, it is actually a subtraction). If the resulting limit becomes 0 or negative, this method terminates without doing anything. For example, if -2*1024*1024 is specified, it is treated as if a value 2MB less than the current cache limit was specified. This is useful when you want to leave some free space in the cache.
timeout Specifies the timeout (time limit) in milliseconds. If 0 is specified, there is no limit.
This method will stop loading subsequent images and return once the time specified by this argument has elapsed. However, if a timeout occurs while a specific image is being loaded, it will not return until that image's loading is complete.
Return Value
None (void)
Description
This method attempts to put the specified images into the cache. However, while this method makes an effort to put images into the cache, there is no guarantee that the images will actually enter the cache. Image loading will be interrupted if the image cache limit is exceeded or a timeout occurs. Among the items specified in the storages argument, those listed earlier have a higher probability of entering the cache (higher priority). If a specified image is already in the cache, it simply raises its survival priority within the cache.
This method ignores all errors during image loading.
In the current version, the images that can be cached with this method are typically those loadable via Layer.loadImages and which do not specify a color key (images with alpha channels are fine). Rule images for universal transitions and region images will be loaded, but they will not become valid cache data (the loaded data will be wasted), so please do not specify them.
Please refer to System.graphicCacheLimit for the number of bytes used by images in the cache.