How do I paste snapshot?

Get help using Construct 2

Post » Mon Dec 29, 2014 1:35 pm

hello i have done a canvas snapshot, how can i save the snapshot inside a sprite?
B
37
S
15
G
7
Posts: 1,679
Reputation: 9,610

Post » Mon Dec 29, 2014 7:05 pm

this is what i need to solve now :s
B
37
S
15
G
7
Posts: 1,679
Reputation: 9,610

Post » Mon Dec 29, 2014 11:18 pm

can someone help?
B
37
S
15
G
7
Posts: 1,679
Reputation: 9,610

Post » Tue Dec 30, 2014 12:46 am

1. Use the "snapshot canvas" action
2 under a "On canvas snapshot" condition use:
3 sprite->"load image from url" action with the CanvasSnapshot expression.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Tue Dec 30, 2014 12:58 am

thanks :D
B
37
S
15
G
7
Posts: 1,679
Reputation: 9,610

Post » Tue Dec 30, 2014 8:14 am

R0J0hound wrote:1. Use the "snapshot canvas" action
2 under a "On canvas snapshot" condition use:
3 sprite->"load image from url" action with the CanvasSnapshot expression.

Ooh, this is useful for many things, thanks, @R0J0hound - is there a way to capture a specific part of the canvas?
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Tue Dec 30, 2014 6:11 pm

@Somebody
Well you can capture to a lower resolution image with this:
how-do-i-canvas-span-class-posthilit-snapshot-span-at-a-lower-resol_p864570?#p864570
You could change the scroll and zoom so what you want to capture covers the screen, and then you can capture a lower res image.

Or it can be modified to capture an area of a certain size.

Edit: It wasn't always working with webgl on. The trick is you need the canvas to redraw for it to work. So to get it to redraw you need something moving, and at least one object spinning would do that trick.
You do not have the required permissions to view the files attached to this post.
Last edited by R0J0hound on Thu Jan 01, 2015 5:15 pm, edited 1 time in total.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Tue Dec 30, 2014 10:26 pm

Thanks, @R0J0hound, I'll make sure to try it out - just changing some UI things here so when that's done it'll be testing time.

Since it's becoming increasingly clear that you simply know EVERYTHING, perhaps you have some ideas for this as well? how-do-i-avoid-terrible-quality-on-scaled-objects_t121736
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Mon Jan 05, 2015 4:46 am

I played around with Rojohounds capx, and it seems to only work in Internet Explorer.
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Mon Jan 05, 2015 9:57 pm

@AllenR
You can use the Snapshot action instead. For for a 100x100 image centered on position 50x50 you could do this:
---Set canvas size to 100x100
---scroll to (50, 50)
---Take Snapshot

on snapshot
---set canvas size to 640x480
---scroll to (320,240)
---invoke download of canvasScreenshot

The second scroll to is to scroll back to the original scroll location. If the layout isn't using unbounded scrolling you could also use (0,0).
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Next

Return to How do I....?

Who is online

Users browsing this forum: DharmaOne, Rhindon and 18 guests