@ValeryKV wrote:
Hello,
When my scene starts, I preload a plist. I use cc.loader.loadResAll. It also loads ".png" and all sprites.
Then I need to get a SpriteFrame by name. Now I use the code:cc.loader.loadRes(atlasName, cc.SpriteAtlas, function (err, atlas) { atlas.getSpriteFrame(spriteName); }
At this line of code, I know that the resource is loaded. I just need to get it. But I cannot pass cc.SpriteAtlas to getRes.
I call loadRes above many times when I create new sprite and I do not know how this effects on performance. That is why I wanted to use getRes.Any idea how to get cc.SpriteAtlas calling getRes or there is another solution?
Regards,
Valery.
Posts: 5
Participants: 3