Friday, July 8, 2022
HomeGame DevelopmentLoading sprite-sheet png dynamically from url for the Atlas - Cocos Creator

Loading sprite-sheet png dynamically from url for the Atlas – Cocos Creator


Hiya,
I’ve 6 photos that’s transformed to sprite sheet and it’s identify is dynamic-images.plist and dynamic-images.png I’m loading it and getting the sprite frames within the following manner.

/sources.loadDir("dynamicAtlas/", SpriteAtlas, (err, atlas) => {
    this.spriteFrames = atlas[0].getSpriteFrames();
});

Now if I’ve to make use of totally different photos then I’ve to interchange the present dynamic-images.png with the totally different picture and create a construct.
dynamic-images.plist is not going to be modified, solely photos will likely be changed with different photos in the identical place and with similar dimension as earlier photos.

What I need is to load the dynamic-images.png from the server URL and get all of the spriteFrames in order that I don’t must take a construct everytime I would like to make use of the totally different photos.
Is it potential to interchange the brand new picture that’s loaded from URL as an alternative of current photos?
I’m utilizing Cocos Creator 3.4.1
Thanks


You’ll be able to attempt to modify the SpriteAtlas photos via the customization engine.

Are you able to please present slightly extra particulars on find out how to obtain that?
It will be helpfull if there’s any demo.
Thanks

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments