Way To save a sprites current image to the game?

Get help using Construct 2

Post » Mon Jul 01, 2013 11:02 pm

Hi,

I'm hoping to make an app that lets the user provide an image URL, and then the app would download the image and then store it locally so it could reuse that image again without the further need to go back on-line. Any chance of making this happen?

Any thoughts?

Cheers,
Mike
B
47
S
9
G
4
Posts: 421
Reputation: 6,959

Post » Mon Jul 01, 2013 11:13 pm

maybe

pode's filesaver

and load in image via url
ImageImage
B
66
S
19
G
7
Posts: 815
Reputation: 9,718

Post » Mon Jul 01, 2013 11:23 pm

Rojo's canvas plug is the most obvious way.

Paste the sprite into the canvas, then save the Canvas.imageUrl into webstorage.

The system has a way to grab the screen, but thats the whole screen uncropped.
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588

Post » Tue Jul 02, 2013 8:50 am

Thanks everyone,

@Newt, I need to keep the alpha (transparency) of the image, so saving the canvas won't work for me, right?
B
47
S
9
G
4
Posts: 421
Reputation: 6,959

Post » Tue Jul 02, 2013 12:44 pm

It should work fine, as long as the canvas is blank beforehand, and its bounding box is bigger than the object you are pasting into it.
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588

Post » Tue Jul 02, 2013 4:57 pm

Cool, I'll give that a shot. thanks.
B
47
S
9
G
4
Posts: 421
Reputation: 6,959

Post » Thu Sep 05, 2013 5:39 pm

...wait, you save the imageurl to webstorage... then how do you get it back? Does that save the whole image or just a url pointer to it?
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
56
S
15
G
5
Posts: 163
Reputation: 7,891


Return to How do I....?

Who is online

Users browsing this forum: repkino and 2 guests