Buffer API, how to change existing image

Hello, I want to be able to change existing sprite (or in this case, atlas) but I’m not quite sure how to do it. I checked out draw_pixels (https://github.com/britzl/publicexamples/tree/master/examples/draw_pixels) public example and when I try to use some other image instead of fully transparent included canvas it gets turned transparent the moment I click/touch it. I’m pretty sure that it happens because it creates buffer of empty pixels and then just overwrites the canvas.

So, my question is:

  • How do I get the existing sprite (atlas) buffer? Do you do it with buffer.copy_buffer()by somehow passing it the hash that points to the image (atlas) I want?