[SOLVED] How do I canvas snapshot at a lower resolution

Get help using Construct 2

Post » Mon Jul 27, 2015 4:06 am

Good deal, makes total sense. Thanks for your help @R0J0hound.

I am running into one problem though. I implemented the code into my game take a canvas snapshot upon a button press. Working backwards I could only get it to work on tickcount==1. The same was true in your example

If I changed your example to tickcount==2, it stopped working:

Any guesses? Thanks!
Posts: 163
Reputation: 8,484

Post » Mon Jul 27, 2015 6:42 am

It could be webgl related perhaps? Not sure, I don't use webgl currently.

It possibility could be that the timing of when c2's canvas is copied is when the canvas is between redraws when it's cleared? That's my only guess and it could be entirely wrong, also when I've looked into a solution in the past I've not had much success.

A third possibility is no value is ready when invoking a download at that moment. Just a thought and since the built-in snapshot action has a "on canvas snapshot" condition, it may be a possibility. An idea could be to assign the last line of the script to a global var, and in events and then every tick check if the global is set before saving it.

But taking a step back it may help to just use the snapshot action, since that is known to work.
Here's how:
https://dl.dropboxusercontent.com/u/542 ... pshot.capx

use low quality fullscreen scaling
set the canvas size
zoom out the layout so the same stuff is seen.
wait 0 so c2 has a chance to adjust the layout
scroll to the center
take snapshot.

Then after the snapshot set everything back to what it was.
Posts: 5,556
Reputation: 85,325


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests