You are currently viewing the gmlscripts.pro static mirror. Forum access and script submissions are not available through this mirror.

Invert gmlscripts.pro

map_sprites

map_sprites(map)
Fills a given map data structure with the id values of all sprite resources, keyed by strings of their names.
COPY/// map_sprites(map)
//
//  Fills a given map data structure with the id values of all
//  sprite resources, keyed by strings of their names.
//
//      map         map data structure, real
//
/// gmlscripts.pro/license
{
    var surf,no,i,ds_map;
    ds_map = argument0;
    surf = surface_create(1,1);
    no = sprite_create_from_surface(surf,0,0,1,1,false,false,0,0);
    surface_free(surf);
    sprite_delete(no);
    for (i=0; i<no; i+=1) {
        if (sprite_exists(i)) {
            ds_map_add(ds_map,sprite_get_name(i),i);
        }
    }
    return 0;
}

Contributors: paul23, RaniSputnik

GitHub: View · Commits · Blame · Raw