8Observer8 Posted January 21, 2017 Share Posted January 21, 2017 Hello How to load images to JSFiddle? I coped this example: http://jsfiddle.net/luckylooke/ywzmkso3/ To this: https://jsfiddle.net/8Observer8/p62bkgpb/ But images did not load Link to comment Share on other sites More sharing options...
8Observer8 Posted January 21, 2017 Author Share Posted January 21, 2017 I found the answer here: https://jsfiddle.net/8Observer8/98xrv9x5/7/ This code is from this tutorial: https://developer.mozilla.org/en-US/docs/Games/Tutorials/2D_breakout_game_Phaser function preload() { handleRemoteImagesOnJSFiddle(); // ... game.load.image('ball', 'img/ball.png'); } // This function (needed only on JSFiddle) take care of loading the images from the remote server function handleRemoteImagesOnJSFiddle() { game.load.baseURL = 'https://end3r.github.io/Gamedev-Phaser-Content-Kit/demos/'; game.load.crossOrigin = 'anonymous'; } Link to comment Share on other sites More sharing options...
Recommended Posts