Argument Description ind The index of the sprite to change the transparency map of. filename The filename for the saved sprite strip.
This function will create a strip image of all sub-images from a sprite. You can specify the name of the file to be saved, but the actual file type must be *.png.
var spr, i;
spr = sprite_create_from_surface(0, 0, 32, 32, true, true, 16, 16);
for (i = 1; i < 8; i +=1)
sprite_add_from_surface(spr, i, 0, 32, 32, true, true, 16, 16);
The above code creates a sprite from the surface indexed in the variable "surf", assigning its index to the local variable "spr_Custom", and then uses a for loop to move across the surface and capture various sections which are added into the sprite as sub-images. this new sprite is then saved as a png strip before being removed from memory.