yvzyldrm Posted June 29, 2014 Share Posted June 29, 2014 hi there I have a problem like mine. I want to upload pictures from an address now. necessarily have to make it through, but staying in preload. Once the game starts loading can not I? preload:function() { this.game.load.image('profilepic','https://abc.com/profile.jpg');}profileButtonAction:function() { profileButton.loadTexture('profilepic');}i want; profileButtonAction:function() { this.game.load.image('profilepic','https://abc.com/profile.jpg'); profileButton.loadTexture('profilepic');}or async image loader?Please do not solve these issues Link to comment Share on other sites More sharing options...
lewster32 Posted June 30, 2014 Share Posted June 30, 2014 There appears to be a problem with loading images outside of preload states at the moment which a few people have posted about - the preloading works and the load complete event fires, but the image seems to still not be usable. Link to comment Share on other sites More sharing options...
Gurebu Posted June 30, 2014 Share Posted June 30, 2014 Hi, I've done something like that and it seems to work all right so far: function _fileComplete(progress, cacheKey, success, totalLoaded, totalFiles) { if (success) this.loadTexture(cacheKey);}function dynamicLoadImage(game, x, y, url, fallback, key) { if (typeof key === 'undefined') key = 'dynamicLoad_' + url; if (game.cache.checkImageKey(key)) { return game.add.image(x, y, key); } else { var image = game.add.image(x, y, fallback); var loader = new Phaser.Loader(game); loader.image(key, url); loader.onFileComplete.addOnce(_fileComplete, image); loader.start(); return image; }} Raptisha and lewster32 2 Link to comment Share on other sites More sharing options...
yvzyldrm Posted June 30, 2014 Author Share Posted June 30, 2014 yes, yes. thanks dude Link to comment Share on other sites More sharing options...
lewster32 Posted June 30, 2014 Share Posted June 30, 2014 Nice Link to comment Share on other sites More sharing options...
Recommended Posts