Skip to main content

The "surface_read" Function

Syntax#

surface_read(surf);
ArgumentTypeDescription
strstringA previously-written surface string to convert into a surface

Description#

Returns a surface from a base64-encoded string previously generated by surface_write. Invalid strings will return undefined. Especially useful for save files and networking.

Example#

ini_open(working_directory + "save.dat");
var my_surf = ini_read_string("data", "screenshot", undefined);
ini_close();
if (!is_undefined(my_surf)) {
draw_surface(my_surf, x, y);
}