How do I save just a part of the canvas as an image?

Get help using Construct 2

Post » Thu Aug 14, 2014 3:38 pm

I'm having a little trouble implementing this plugin: plugin-c2i-canvas-base64-screenshot-to-image_t68493

I want the user to be able to save out an image that is saved from a specific part of the canvas, rather than just screenshotting and downloading the entire canvas.

Capx is here: https://www.dropbox.com/s/lb3t6wxr7jpzye1/save_canvas.zip
Live demo is here: http://www.angelserver.in/html5/save_canvas/

First click 'use webcam', then hit the 'snap' button to capture your face in the frame.
Then hit save canvas, which supposedly saves a screenshot between points 1 and 2 (marked on live demo).
Then hit show image, which is supposed to load the resultant screenshot in a new tab, for saving.

Event sheet is below:
Image

Pretty sure I'm doing something wrong, but I've tried many variations and am having trouble figuring out what :( any help would be appreciated to shed some light on this. Thank you.
B
7
S
1
Posts: 61
Reputation: 588

Post » Fri Aug 15, 2014 9:13 am

Update to add some extra information:

What currently happens upon clicking save is a new tab is opened, and a "Not Found. The requested document was not found on this server." error occurs.

This would lead me to believe that something is going wrong at the saving stage, but I can't quite figure out what.

Where is the .png being saved? This is something that wasn't clear to me when I followed the original example.
B
7
S
1
Posts: 61
Reputation: 588

Post » Wed Aug 27, 2014 9:05 pm

Did you ever figure this out? Seems like you would have to specify in your events sheet a place to save the .png

Also, try saving your project as a single file & uploading that to dropbox.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Mon Sep 01, 2014 9:01 am

@miketv I never did figure this out, no... :(

I couldn't find a place to specify where to save the .png; this seems to be the problem? I'm back on investigating this stuff today, so I'll update if I get any further.

As a single file? Is that an export setting somewhere?
B
7
S
1
Posts: 61
Reputation: 588

Post » Mon Sep 08, 2014 6:22 pm

When you go to save your game: click on the "File" gear at the top left of the window, scroll down to "save as single file..." and that's where you get your .capx (which can then be uploaded to dropbox)
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Mon Sep 08, 2014 8:06 pm

snapshot-canvas-extension_t107135 this may be of interest for you, it is not using the same plugin however.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests