How do I take a snapshot and save it

Get help using Construct 2

Post » Mon Jul 27, 2015 8:32 pm

I export my game in NW.js for Steam. I need a way to automatically save a snapshot to a specific folder (Desktop/DinoSystem or Documents/DinoSystem).

I succesfully did something similiar with save dialog using js:

"var fs = require('fs');fs['writeFileSync']('" &replace(NodeWebkit.ChosenPath,"\","\\")& "','" &CanvasSnapshot& "'.split(',')[1], {'encoding': 'base64'});"


But now i need it to automatically save the screen in the aforementioned folder! Any hint?
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Tue Jul 28, 2015 4:21 pm

I am not sure JavaScript is allowed to do that (for security reasons).

There is one library, and a few hacks that I found on StackOverflow:
http://stackoverflow.com/questions/1340 ... -save-file
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests