How do I make C2 poop out a .PNG file from HTML game?

Get help using Construct 2

Post » Tue Feb 24, 2015 4:57 am

Hi,

Can we have the screenshots save to disk on an android device from HTML5? How about a PC?

Thanks in advance.
B
28
S
8
G
4
Posts: 767
Reputation: 5,940

Post » Tue Feb 24, 2015 6:39 am

In the Browser Object is "Invoke Download"

I.E.:

Take snapshot of canvas (PNG, quality 75)
Invoke download of CanvasSnapshot with Filename "Capture.png"
B
205
S
53
G
30
Posts: 897
Reputation: 36,856

Post » Tue Apr 21, 2015 3:55 pm

@Paradox Is there any way to save just a part of the canvas, or a sprite area to a file? (during the runtime.. as png/jpg)
B
23
S
7
G
1
Posts: 186
Reputation: 2,691

Post » Tue Apr 21, 2015 4:29 pm

Maybe within the snapshotting event set the size of the layout and scroll to the part of the screen you want to screenshot of, snapshot, and then immediately set the screen back to the prior settings. Never tried if that works, but that's the only approach I can think off with the standard objects of Construct 2 for now.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
20
S
9
G
1
Posts: 786
Reputation: 3,729

Post » Tue Apr 21, 2015 5:20 pm

You mean "pop" out not poop out right? :lol:
ImageImageImageImageImage
B
50
S
14
G
5
Posts: 852
Reputation: 11,046

Post » Tue Apr 21, 2015 8:59 pm

I haven't done it in a long time, but I think MindfaQ's method is how I did it. Set everything but what you want invisible, including the background layer if you want transparent PNGs. I think it flashed on screen for one tick, but you hardly noticed it happen.
B
205
S
53
G
30
Posts: 897
Reputation: 36,856

Post » Thu Apr 23, 2015 8:40 am

@mindfaQ @Paradox Yes, that method works but only with full screen scaling off to get 1:1 scaling. Still, it's good for what I need. Many thanks!
B
23
S
7
G
1
Posts: 186
Reputation: 2,691


Return to How do I....?

Who is online

Users browsing this forum: makkancs, olympo and 7 guests