The company's people want to use the keel, but colleagues on the official website can not find the binary information ... So I wrote a simple demo.
The demo contains frame animations, skeleton animation json, fast and binary resources and code
Test environment:
Dragonbonespro 5.5 (5.6 has been error can not be exported, later said to be unregistered login ...)
Egret Wing4.1.0
Egretegnie 5.0.14
Directory: one, code run
Second, efficiency and memory consumption comparison
Three or two how to use the binary keel
Four, the demo download
First, the code runs:
The keel animation used in the demo comes from the dragon that opened the Dragonbone software home page
Second, efficiency and memory consumption comparison:
Here the picture of frame animation is not compressed ha, looks 5m really scary, can be compressed on the tiny, compressed is more than 800 KB.
Three or two how to use the binary keel
The latest binary format is generally used and is officially recommended.
Software--Export--binary, top left menu file
Get 3 files and put them under the Egret Project resource Resources folder
Import a file into a resource configuration file Default.res.json
The binary Dbbin file needs to be selected as bin type
Import the Dragonbones library into the Egretproperties.json file and compile the engine again
Creating skeletal animations in code
[AppleScript]Plain Text view copy code ?
12345678 |
let factory
= dragonBones.EgretFactory.factory;
factory.parseDragonBonesData
(
RES.getRes
(
"NewDragon_ske_bin"
)
)
;
factory.parseTextureAtlasData
(
RES.getRes
(
"NewDragon_tex2_json"
)
, RES.getRes
(
"NewDragon_tex3_png"
)
)
;
this.armatureDisplay
= factory.buildArmatureDisplay
(
"armatureName"
)
;
this.armatureDisplay.animation.play
(
"stand"
,
0
)
;
this.addChild
(
this.armatureDisplay
)
;
|
Four, the demo download
"Salted fish Tutorial" dragonbones frame animation, skeleton json, fast, binary