sprite_save_strip

Saves a sprite to disc as a strip image.

Syntax:

sprite_save_strip(ind, filename);


Argument Description
ind The index of the sprite to change the transparency map of.
filename The filename for the saved sprite strip.


Returns: N/A


Description

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.

NOTE: Depending on the target platform that is chosen you are limited as to where you can save and load files from. See Reference - Files for more information.




Example:

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);
   }
sprite_save_strip(spr, "Custom_Player_Sprite.png");
sprite_delete(spr);

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.


Back: Sprites
Next: sprite_flush
© Copyright YoYo Games Ltd. 2018 All Rights Reserved