With this function you can write data into a buffer at the specified offset, without changing the seek position. This is different from buffer_write, which uses the current seek position as the offset and advances that with the amount of bytes written.
You supply the function with a buffer, 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.
buffer_poke(buffer, offset, type, value);
Argument | Type | Description |
---|---|---|
buffer | Buffer | The buffer to use. |
offset | Real | The offset position (in bytes) within the buffer to write the given data to. |
type | Buffer Data Type Constant | The type of data that is to be written to the buffer (see the list of constants here). |
value | Any | The data to add to the buffer, in accordance with the type specified. |
N/A
buffer_poke(buff, 3, buffer_u8, colour_get_blue(image_blend));
The above code will add the blue component value of the calling instance's image_blend colour into the buffer stored in the variable buff, at the third position in the buffer as an unsigned 8bit value.