texture_is_ready

This function can be used to check if a specific texture page has been unpacked and is ready for use, or if a group of texture pages have been unpacked and are ready for use.

You supply the unique texture page ID (as returned by the texturegroup_* functions) or the texture group ID string (as defined in the Texture Group Editor), and the function will return true if they have been unpacked, or false otherwise.

 

Syntax:

texture_is_ready(tex_id);

ArgumentTypeDescription
tex_idTexture or StringThe texture page pointer or a texture group name (a string)

 

Returns:

Boolean

 

Example:

var _tex_array = texturegroup_get_textures( "MainMenu");
for (var i = 0; i < array_length(_tex_array); ++i;)
{
    if !texture_is_ready(_tex_array[i])
    {
        texture_prefetch(_tex_array[i]);
    }
}

The above code will retrieve the texture page IDs for the texture group "MainMenu", then check to see if they are unpacked, and if they are not they are prefetched into VRAM.