Basically I managed to create two db atlases and import them to cocos as follows:
- import dragonbones asset to cocos creator
- Navigate to it’s folder (r click>open in explorer)
- copy and paste the YourAsset_tex.json file and YourAsset.png file - so they have a duplicate each
- Open the new copy - NewYourAsset_tex.json file and change the line that points to the original texture:
YourAsset.png --> NewYourAsset.png - Edit the new duplicate of the atlas image (NewYourAsset.png) - change the hue or scribble ontop for test
- Back in cocos creator, drag and drop NewYourAsset_tex resource ontop of the dragonbones-atlas box, to replace the original one
The editor will not update it with the new one, until you save and restart. However if you run the game - you will see that the new atlas works and now you have two functional atlases in your cocos creator project.
Now my question is -
how do I swap them during runtime via script? I couldn’t find any example code of that anywhere.
Help much appreciated