Save and load canvas plugin image

Get help using Construct 2

Post » Thu Sep 05, 2013 1:52 pm

...or any image really. I know the canvas plugin has an 'asJSON property --which I can save in a dictionary or something, but how do you get the image BACK from that JSON string?

I just need to save and load image files which result from canvas manipulations to and from the web storage.

Anybody done this?
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
62
S
17
G
5
Posts: 171
Reputation: 8,329

Post » Thu Sep 05, 2013 5:45 pm

OK I did it. I didn't quite get that the imageurl from a canvas IS the image itself in text form. That can be saved and loaded no problem.

Anyhow That's a way to do it and the way I'm going with. Phew!

It helps to talk about it...sinistar992013-09-05 17:46:43
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
62
S
17
G
5
Posts: 171
Reputation: 8,329

Post » Thu Sep 05, 2013 5:46 pm

Right now the way it's done is to load it into a sprite and then pasting it back into the canvas.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Thu Sep 05, 2013 7:05 pm

Yep. I'm working on a "my doodle game" type game so I'm doing that all over the place. Does save game save dictionary contents too? I guess I'll find out...
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
62
S
17
G
5
Posts: 171
Reputation: 8,329


Return to How do I....?

Who is online

Users browsing this forum: David181, jorgmaquoi, MPPlantOfficial, unicornspitfire and 20 guests