First of all, I'm not the first author to make a similar viewer, the first author I know is Johance, and here is the post it posted in Cocoschina.
Share the Turret Viewer Flash Guide publication (with detailed explanation) and Flash Guide to the batch file
Http://www.cocoachina.com/bbs/read.php?tid-219173.html
The post describes the file format of the skeleton animation of the turret legend, which I wrote in reference to this file format. My idea is to convert the *.FCA file into the format required by Dragonbonescpp, and then you can play it through the dragonbonescpp. Note that there is no conversion to dragonbonescpp Skeleton.xml, but directly into the Dragonbonescpp parsing skeleton.xml data structure, eliminating the intermediate links. Of course you can also export Dragonbonescpp's three files through the code interface I implemented SHEET.PVR, Texture.xml, Skeleton.xml, and then load the playback as you normally would with Dragonbonescpp, which avoids the load-time conversion and is more efficient.
The *.FCA file is a zip archive that, after being extracted with WinRAR, can get three files of Cha, plist, SHEET.PVR, where SHEET.PVR is a grain set picture containing all the skeletal plots used by the character. Plist is a skeleton description file of the texture set, which describes the coordinates, size, and other area information of each bone plot in the SHEET.PVR large map. Cha is a skeletal animation data file in the format described below.
Cha format:
Statement:
The following format comes from the posts published by Johance, with only a few modifications and additions.
{} represents a data structure with ... Indicates that there are multiple data structures.
Role name Length (4B)
Role name does not contain "\"
Number of Bones (4B)
{
Bone name Length (4B)
Bone Name
Skeleton picture filename Length (4B)
Skeleton picture file name
Bone Index (4B)
}...
Number of animations (4B)
{
Animation name Length (4B)
Animation name
Unknown data (4B) fixed to 0x41c00000
Number of animation frames (4B)
{
Frame Type (4B)
{
The frame type is 1 o'clock only need to parse this structure, otherwise skip this structure
Unknown data 1 (4B)
Sound file name Length (4B)
Sound file name
Unknown sound data (32B)
Unknown data 2 (4B)
}
Number of bones used in the current frame (4B)
{
Bone Index (2B)
Transparency (1B)
A, B, C, D, TX, Ty (6 float in the matrix similar to flash)
}...
}...
}...
Please refer to the following articles and as codes for the detailed meanings of the 6 floats in the matrix similar to the one in Flash.
AS3 Matrix in detail
http://wgcode.iteye.com/blog/838550
Matrixtransformer.as:
Public Static functionGetscalex (M:matrix): Number{ returnMATH.SQRT (M.A*M.A + m.b*m.b);} Public Static functionGetscaley (M:matrix): Number{ returnMATH.SQRT (M.C*M.C + m.d*M.D);} Public Static functionGetskewx (M:matrix): Number{ returnMath.atan2 (-M.C, M.D) * (180/MATH.PI);} Public Static functionGetskewy (M:matrix): Number{ returnMath.atan2 (M.B, M.A) * (180/MATH.PI);}
The legend of the turret Skeleton Animation viewer:
"The Legend of the turret" cottage (not completed, will be open for some time later):
Development environment:
cocos2d-x-3.3 Final
Dragonbonescpp
Windows installation package:
Http://pan.baidu.com/s/1dDyBu85
Android installation package:
Http://pan.baidu.com/s/1rVOCI
Resources:
Http://pan.baidu.com/s/14NgoI
Project Address:
Https://github.com/zym2014/DotaSkeletonAnim
2015 Lantern Festival Gift--"turret legends" skeleton animation viewer, open source!