-
Creator 版本:2.0.9
-
目标平台: Web / 模拟器
-
详细报错信息,包含调用堆栈:
-
重现方式:必现
-
出现概率:100%
2.1.0版本中没有这个问题,在2.0.9中不报错,但是不显示图,debugBones设成true,可以看到骨骼的红线,但是就是不显示图。
参见官网代码:
如何从服务器远程加载 DragonBones ?
var animNode = new cc.Node();
animNode.parent = cc.find(‘Canvas’);
var dragonDisplay = animNode.addComponent(dragonBones.ArmatureDisplay);
var image = ‘http://localhost:7456/res/raw-assets/eee_tex-1529064342.png’;
var ske = ‘http://localhost:7456/res/raw-assets/eee_ske-1529065642.json’;
var atlas = ‘http://localhost:7456/res/raw-assets/eee_tex-1529065642.json’;
cc.loader.load(image, (error, texture) => {
cc.loader.load({ url: atlas, type: ‘txt’ }, (error, atlasJson) => {
cc.loader.load({ url: ske, type: ‘txt’ }, (error, dragonBonesJson) => {
var atlas = new dragonBones.DragonBonesAtlasAsset();
atlas.atlasJson = atlasJson;
atlas.texture = texture;
var asset = new dragonBones.DragonBonesAsset();
asset.dragonBonesJson = dragonBonesJson;
dragonDisplay.dragonAtlasAsset = atlas;
dragonDisplay.dragonAsset = asset;
dragonDisplay.armatureName = 'box_anim';
dragonDisplay.playAnimation('box_anim', 0);
});
});
});

