Add data to a buffer at a specific position.


GML Code Example

buffer_poke(buffer, offset, type, value);

Argument Description
buffer The index of the buffer to use.
offset The offset position (in bytes) within the buffer to write the given data to.
type The type of data that is to be written to the buffer (see the list of constants here).
value The data to add to the buffer, in accordance with the type specified.

Returns: N/A


With the buffer_write function, you can write data to the given buffer at the current "seek" position, with each piece of data advancing this position by the bytes being written or read. However, it may be necessary for you to change a given piece of data without wanting to change the current seek position, and that's when you would use this function. You simply supply the function with a buffer index, and then the offset position from the buffer start (in bytes) within that buffer to write to, as well as the data type and the value to be written.


GML Code Example

buffer_poke(buff, 3, buffer_u8, colour_get_blue(image_blend));

The above code will add the blue component value of the colour used for the image blend into the buffer indexed in the variable "buff", at the third position in the buffer and as an unsigned 8bit value.

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