Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

This extension uses a trick involving drawing the GM canvas onto another canvas to get base64 of it, but surfaces are not canvases on WebGL.

I think your best bet would be to grab pixels using buffer_get_surface, then grab a raw buffer object (Uint8Array I think? Or maybe ArrayBuffer) using buffer_get_address, then convert those pixels into ImageData, then putImageData it onto canvas, and then you can finally get base64 of it and use the rest of the existing code.

(2 edits)

Hi, Thank you so much for answering, sorry I wasn't clear that I was using Gamemaker... I see that I can go up to the buffer_get_address in gamemaker, but can't see ImageData or putimagedata... so I'd have to make an extension from there in JS for it to work? :) 

Correct - either make an extension or edit this same one (since it has some of the code anyway)

Thankyou :) I'll give it a go, I hadn't seen that the code was with the extension.