jung34 Posted September 8, 2015 Share Posted September 8, 2015 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 More sharing options...
rich Posted September 8, 2015 Share Posted September 8, 2015 You can do this just like you've done it - AS LONG as the web site allows cross-site origin requests (google for CORs for more details). Link to comment Share on other sites More sharing options...
Skeptron Posted September 8, 2015 Share Posted September 8, 2015 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 More sharing options...
Recommended Posts