Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17083

Why cc.loader.getRes does not accept "type"

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 17083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>