Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Screenshot save dialog

GameMaker & Construct 2 plugins to let user pick where to save screenshot(s). · By YellowAfterlife

I've tried using it but I obtain a completely black image

A topic by Sileno created Mar 08, 2017 Views: 890 Replies: 3
Viewing posts 1 to 2

I'm using GM: Studio and what I get after using the extension's command (I've inspected also the example project and it seems I'm doing nothing wrong) and after saving the image is a completely black image (interpreted as completely transparent image in Windows's images viewer) with the resolution of the canvas in witch i'm running the HTML5 game exported.

The strange thing is that your demo works just fine on the same browser (Chrome) and with the same simple call you show. Am I maybe forgetting some simple basic concept or mechanism in GM that could interfere with my project?

Developer

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).

[SOLUTION FOUND]

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
(+1)

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!