I am building an roulette game with Cocos Creator v1.5.1
I am using following code to load the roulette wheel sprites
Each sprite is 378x233
I switch the sprites manually to show wheel spinning
cc.loader.loadResDir(folderName, cc.SpriteFrame,
function(completedCount ,totalCount ,item)
{
cc.log("progress " + completedCount*100/totalCount);
},
function (err, assets)
{
if (err) {
cc.error(err.message || err);
return;
}
for (var i = 0; i < assets.length; i++) {
// load the frames in the animation to the array
self._frameHolder[i] = assets[i];
}
});
Sprite in the game is type : SIMPLE size mode : ROW
This works perfectly on all the browsers except Firefox.
It gives the error “Rect width exceeds maximum margin: 3300”
Instead of the wheel image it shows a white area.
Can someone provide some help on this?
After investigating this further, I feel the problem is in the cc.loader.loadResDir
If I add the images manually to the array the problem goes away.
I also have the same problem loading images from atlas with “getSpriteFrame”
The problem only in Firefox though…
Any ideas what I should do?