Jump to content

Load image from URL


jung34
 Share

Recommended Posts

Hi, I'm attempting to load an image from a url and it doesn't work, please help:

 

For example:

this.load.image('test', 'http://phaser.io/images/img.png');

 

I'd like to load images from other websites during runtime.

 

The purpose is to display content specific to the game player and accessed from the website they are logged into, e.g. their pictures in facebook, google+, etc..

 

Thank you very much for responses!

Jung

 

Link to comment
Share on other sites

I'd like to load images from other websites during runtime.

 

You can't do that for many reasons (security, load etc.). Browsers won't allow that unless Facebook explicitly agrees through CORs (like Rich said), which is very unlikely to happen.

 

If you want to use some Facebook data or assets for example, you can look at their API. It is possible to fetch user avatar, username etc. But it's a lot more complicated than just point to their URL.

 

And the APIs are specific to each website or application (if any). Unfortunately there is global way of using data from any website.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...