buffer_save

This function saves the contents of a buffer to a file, ready to be read back into memory using the buffer_load function.

NOTE On HTML5 the contents of the buffer will be saved as base64 encoded strings when using this function.

 

Syntax:

buffer_save(buffer, filename);

ArgumentTypeDescription
bufferBufferThe buffer to save.
filenameStringThe name of the file to save as.

 

Returns:

N/A

 

Example:

buffer_save(buff, "Player_Save.sav");

The above code saves the current contents of the buffer stored in the variable buff to a file.