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
48
S
9
G
4
Posts: 425
Reputation: 7,002

Post » Mon Jul 01, 2013 11:13 pm

maybe

pode's filesaver

and load in image via url
ImageImage
B
69
S
21
G
7
Posts: 824
Reputation: 10,011

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
167
S
50
G
159
Posts: 8,168
Reputation: 102,932

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
48
S
9
G
4
Posts: 425
Reputation: 7,002

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
167
S
50
G
159
Posts: 8,168
Reputation: 102,932

Post » Tue Jul 02, 2013 4:57 pm

Cool, I'll give that a shot. thanks.
B
48
S
9
G
4
Posts: 425
Reputation: 7,002

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
57
S
15
G
5
Posts: 164
Reputation: 7,938


Return to How do I....?

Who is online

Users browsing this forum: Aquanex2 and 1 guest