load Image from url at runtime

Get help using Construct 2

Post » Mon Oct 17, 2011 3:01 pm

How can I load an image from an url and put it on a sprite at run time?
For example, i want to allow the user to use a custom image from an url as the "head" of a person sprite. I would not know the url until runtime, so i can't just pre-load the images using the editor.

Thanks!
B
2
G
1
Posts: 1
Reputation: 552

Post » Tue Feb 19, 2013 9:11 pm

MySQL? I'd like to know too
B
8
S
3
G
2
Posts: 49
Reputation: 1,938

Post » Tue Feb 19, 2013 9:43 pm

Well. You could add a textbox to the layout and, instead of putting down an URL, tell "Load Image from URL" to load the image from the URL entered by the user inside that textbox. In short: Instead of an URL, you would simply write down "Textbox.Text".

However, a better way to load sprites may be the drag and drop behaviour introduced with this plugin:

http://www.scirra.com/forum/plugin-dragndrop-zone_topic58578.html

I was facing a similar problem (I needed this for several sprite based editors inside my point and click adventure engine) when lemo was kind enough to tell me about it.

@sogen

MySQL is for databases. It wouldn't make sense to query a single image through a database (except if you wanted to make an MMORPG/graphical MUD and save several characters' outfits on a server). AJAX is what you're looking for, which essentially is what the Load Image from URL object is mimicing. Blinx1232013-02-19 21:47:08
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Tue Feb 19, 2013 11:57 pm

This thread was posted in October 2011, before the Sprite object had a "Load image from URL" action, which is the solution you are looking for.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests