Home Game Development How to Dynamically Load Resources outdoors sources folder in Cocos Creator 3.5? – Cocos Creator

How to Dynamically Load Resources outdoors sources folder in Cocos Creator 3.5? – Cocos Creator

0
How to Dynamically Load Resources outdoors sources folder in Cocos Creator 3.5? – Cocos Creator

[ad_1]

Is it attainable to dynamically load/name asset with out utilizing sources in Cocos Creator 3.5.0 ?

I do know that this can works:

sources.load("test_assets/picture/spriteFrame", SpriteBody, (err, spriteFrame) => {
this.node.getComponent(Sprite).spriteFrame = spriteFrame;
});

But because of the legacy folder construction, the previous property are positioned outdoors the sources folder. And there are tons of it, I wish to keep away from shifting these oldies.

Let’s say the folder construction is one thing like this:

property
|- Images
 |- Background
  |- bg_mdl.png
  |- bg_rn.png
|- Resources
..
..

So, what i need is to dynamically assign this bg_mdl.png and bg_rn.png right into a sprite node within the scene.

I’m utilizing Cocos Creator 3.5.0 and Typescript. Is it attainable to do it?

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here