The "xzip_write" Function
#
SyntaxArgument | Type | Description |
---|---|---|
arch | string | The full path and filename of the archive to check |
buff | buffer | A buffer containing data to be written to the archive |
file | string | The file name to assign to the buffer in the archive (including relative path, if any) |
#
DescriptionWrites data from a buffer directly into the archive (instead of from a file on the disk) and assigns it a standard file name. Buffers will be compressed with zlib before writing. Once written, buffers can be restored with xzip_read
or extracted and read from disk like any other file.
Also returns true
or false
to indicate if the operation succeeded. Note that this includes failure to overwrite a file flagged as read-only. (This can be determined with xzip_get_readonly
.)
In GameMaker Studio, buffers are simply containers for binary data, and can store anything from text, to audio, to surfaces, and beyond. However, it's important to keep in mind that GameMaker must have a function to interpret the data in order to use it.
#
ExampleThis will copy the application surface in its current state and write it to the archive, essentially capturing a screenshot which can be viewed later.