How can I download remote texture in my game

How can I download remote texture in my game
0

#1

How can I download remote texture, includes image and plist file and use it as normal resource in my game


#2

@slackmoehrle @nite is it possible with Cocos Creator 1.9, I read through the API document but haven’t found anything


#3

http://www.cocos2d-x.org/docs/api-ref/creator/v1.9/en/classes/loader.html#load


#4

thanks for your reference, what I want to archive is download a sprite atlas from remote server to reduce binary file size

cc.loader.load(‘a.png||a.plist’, function (err, tex) {
cc.log('Result should be a texture: ’ + new cc.SpriteAtlas(tex)));
});

I think the code might look like that but it returns the raw text contained within the plist file instead of expected sprite atlas


#5

Yeah sorry man, not sure how to achieve that.
Also as far as i know plist is raw text only, by which the png is sliced in cocos.


#6

@jare can this be done in 1.9?


#7

Sorry, Creator support raw texture only right now. plist will be supported at 2.x.


#8

Hi @jare ,

Cocos Creator is already is 2.1, does it now support remote atlas?


#9

Not support now…


#10

Is there any alternative way to load atlas remotely?


#11

You can load the atlas file simply with XMLHttpRequest.It works for me