Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

Are you doing this outside of Draw events? The first thing I can think of would be the canvas not yet containing the image because of code being called before anything finishes drawing.

Other (less likely) potential causes:

  • Something being odd if you have application_surface disabled
    The game should still draw to canvas though, so seems unlikely
  • Something being odd if you have WebGL enabled
    I know that Microsoft Edge has a bug where WebGL canvas returns blank images, but the demo worked fine for me in Chrome and Firefox with WebGL enabled, so it would have to be some system-specific quirk.
In the second case, would have to either disable WebGL or wait until the next GMS update - there's a WebGL initialization setting that helps with this, but there isn't a GGS option to enable it yet (despite the option' value existing in generated code).


Thanks a lot for the answer. I started checking out what you suggested and everything has been resolved disabling WebGL. I'm so happy it was not one of those mysterious gimmicks that GM sometimes gives.
It's strange thought, as I thought WebGL'd taking care of most of the compatibility problems during the export instead of complicating them (I also had some graphic glitches that are now gone).

Just to give more infos:

  • I was using Chrome, but I've tested it also on Edge and the result was the same.
  • I was not calling the function in a draw event but in a global mouse button pressed.
  • The application surface was enabled. The canvas was prepared to be saved as a screenshot thanks to a previous sequential draw procedure.
Thanks a lot ^w^
Your help made my day <3

P.S.: It's so cool you answered me @_@
I follow you since years and I love what you did with your precious blog (that I find one of the most interesting game making guide blog) and games like SpelunkySD in witch I've spent months!