buffer_load

Load a previously saved buffer.

Syntax:

GML Code Example

buffer_load(filename);


Argument Description
filename The name of the file to load from.


Returns: real


Description

This function will load the buffer data that was previously saved using the buffer_save functions into a new buffer. This new buffer is created by the function as a "grow" buffer (see here) with a byte alignment of 1, and the new buffer id is returned. This ID should be stored in a variable and used in all further function calls to this buffer.

NOTE: It's important that you remove any dynamically created resources like this from memory when you no longer need them to prevent memory leaks, so when you are finished with the buffer that you have created you should free it up again using buffer_delete.


Example:

GML Code Example

player_buffer = buffer_load("Player_Save.sav");

The above code will load a previously saved buffer into memory, creating a new buffer. The index of this new buffer is stored in the variable "player_buffer".


Back: Buffers



No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here