sprite_set_cache_size

Sets the size of the cache for a given sprite.

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 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.


Back: Sprites
Next: sprite_set_cache_size_ext
© Copyright YoYo Games Ltd. 2018 All Rights Reserved