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
  1. /// map_sprites(map)
  2. //
  3. // Fills a given map data structure with the id values of all
  4. // sprite resources, keyed by strings of their names.
  5. //
  6. // map map data structure, real
  7. //
  8. /// gmlscripts.pro/license
  9. {
  10. var surf,no,i,ds_map;
  11. ds_map = argument0;
  12. surf = surface_create(1,1);
  13. no = sprite_create_from_surface(surf,0,0,1,1,false,false,0,0);
  14. surface_free(surf);
  15. sprite_delete(no);
  16. for (i=0; i<no; i+=1) {
  17. if (sprite_exists(i)) {
  18. ds_map_add(ds_map,sprite_get_name(i),i);
  19. }
  20. }
  21. return 0;
  22. }

Contributors: paul23, RaniSputnik

GitHub: View · Commits · Blame · Raw