sprite_set_cache_size


Syntax:

sprite_set_cache_size(ind, max);

Argument Description
ind The index of the sprite to change the cache size of.
max The maximum number of cached copies of the sprite that can be stored.


Returns

N/A


Description

When performing image blending, HTML5 cannot do it dynamically in the same way an executable could be performed. Therefore GameMaker Studio 2 has to temporarily save a blended copy of the image and load it in. This function sets how many blended copies of the given sprite can be cached before old ones are overwritten. Default is 4. This is applied to all subimages of the sprite.


Example:

sprite_set_cache_size(sprite0, 2);

This will set the sprite cache of all subimages of sprite0 to 2 copies.