Use off-site images?

Get help using Construct 2

Post » Mon Apr 22, 2013 11:14 pm

In small websites you use images you store at flickr, picasa, etc.
In other websites you use open images at wikipedia and similar sites.

Is there a way to use external images for sprites and/or backgrounds in your games?

Sprite "Load image from url" works only on your site or XSS enabled sites.

Browser "Download" writes the image in the downloads folder of browser, where you can't access it.

I don't want to make a Php script to serve external images as faked server images.

Any idea?

B
39
S
11
G
5
Posts: 132
Reputation: 8,228

Post » Tue Apr 23, 2013 7:20 pm

What's wrong with the php script option?
If you don't need all the sprite features,
you may wanna try Pode's IMG plugin (from the html pack),
It didn't bother with cross domain last time I tried
(or maybe it was the second link try both :p)

http://www.scirra.com/forum/behavior-inject-base64-string-as-sprite-image_topic50604_page1.html
http://www.scirra.com/forum/plugins-pode-html-pack_topic51522_page1.html
lemo2013-04-23 19:28:41
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Tue Apr 23, 2013 9:29 pm

Images are limited across domains for security reasons. Since it's a potential security vulnerability to get an image from a different server, the server must opt-in to sharing the image by setting up CORS (the Access-Control-Allow-Origin header). This is the intentional design of the web.
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,208

Post » Fri Apr 26, 2013 11:27 pm

Ok, I'll turn into php... bye, bye, offline app!

Also if I want to add an image each day (my project is a jigsaw puzzle), must I re-create the manifest?
That could be affordable for a standard html5 app (i.e. a php script would make a new manifest each day), but not for a chrome app.
B
39
S
11
G
5
Posts: 132
Reputation: 8,228


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests