Marcelo Junior
Marcelo Junior

Reputation: 11

cc.loader.load does not download images bigger than 500 KB - Cocos Creator

I need show an image with more 500 KB, but on iphone does not work and log this:

< no filename="filename"> :0:too much recursion

Example code:

cc.loader.load("http://i.imgur.com/QFnpQq7.png", function(progress) {
                    }, function(error, texture){
                        if (texture !== null) {
                     self.imageSprite.spriteFrame = new cc.SpriteFrame(texture);
                    }
        });

I appreciate any help, tks!

Upvotes: 1

Views: 695

Answers (1)

Milo Martinez
Milo Martinez

Reputation: 1

It's not the size of the image, it has a default timeout (5 sec I think), look in CCBoot.js getXMLHttpRequest and make

var xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP");
xhr.timeout = "your timeout value";

I'll suggest to update it to 10 000 ms, and then it should be fine.

Upvotes: 0

Related Questions