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.


语法:

texture_is_ready(tex_id);

参数 描述
tex_id The texture page ID (an integer) or a texture group ID (a string)


返回:

Boolean(布尔值)


例如:

var _tex_array = texturegroup_get_textures( "MainMenu");
for (var i = 0; i < array_length_1d(_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 them they are placed into VRAM.