This article mainly introduces the relationship between data in flash and data in xml in cocos2dx bone animation Armature source code analysis, the previous article introduces the built-in skeleton animation of cocos2dx, this article introduces the meaning of each field in the exported configuration data (also explains the meaning of each field in the xml data exported by DragonBone ).
Skeleton Node
Name: the name of the flash file.
FrameRate: Specifies the Frame Rate of the flash.
Version: the version number of dragonbones.
Armatures Node
The armatures node intercepts some data in armatures.
……
A node is a skeleton (B is short for bone). A node contains multipleIs the overall skeleton of the animation. As shown in the following two figures, the relationship between the entire layer and the skeleton is an armature node, and each layer in the red box is a B node.
Why does a node have multiple armature nodes? Because a flash can have multiple bone animations, each of which corresponds to an armature. For example, after the flash export, armatures will contain multiple armature. A component with a frame label will be treated as a Skeleton.
The name attribute is the name () of the component in the library and also the name of Skeleton.
Node B (child node of the armature node)
Skeleton information, based on the first frame of information.
Name: the name of the skeleton, that is, the name of the layer in TimeLine ,.
Parent: parent node of the skeleton ,.
X, y: coordinates of the element rotation anchor point relative to the origin of the parent node. For details, see. The downward direction of y is positive.
KX, kY: Indicates skewX and SkewY. Generally, two equal values indicate the Rotate size.
CX, cY: Indicates scaleX and scaleY, indicating the scaling size.
PX, pY: the coordinates of the rotation anchor point relative to the component origin. The rotation is 30 degrees.
Z: hierarchy. The bottom layer is layer 0, which increases progressively.
D Node
Displaying nodes in the skeleton can be understood as skin. When a layer uses components in several libraries, there will be several Node.
Name: displays the object name. It is the concatenation of the path and component name in the library.
PX, pY: displays the object's displacement from the origin.
Animations Node
A node represents a Time-Varying change in the skeleton.
Why are there multiple? The cause is the same as that of multiple attributes (see the preceding Section). The name attribute corresponds to the animation and armature attributes one by one.
Mov Node
If the mov node truly corresponds to an animation in the program, a frame label on the TimeLine will generate an mov, so there will be multiple mov in one.
Name: Specifies the frame tag name.
Dr: the number of frames in a duration and mov duration. We can see that stand lasts for 7 frames.
To: I really don't know what it is.
DrTW: represents duratio_tween, the duration of animation running, 1/24x7 = 0.29 s. Setting TotalTime on the dragonbones panel affects this value.
Lp: Indicates loop and whether loop playback is enabled.
TwE: I really don't know what it is.
Node B (child node of mov node)
The skeleton status. mov has all the bone B nodes.
Name: Bone name
SC: represents movement_scale. I don't know what it is. Adjust the total number of frames. The dragonBones Panel can be adjusted.
Dl: Indicates movement_delay. I don't know what it is. PlayDelay settings in the dragonBones panel should be related to them.
F Node
Key Frame information. The stand animation has three key frames, so there are three f nodes. The attributes of x, y, kX, kY, cX, cY, pX, pY, and z are the same as those of the child nodes of the armature node, cocos2d_x and cocos2d_y do not know how to come.
DI: Which graph is displayed by display_index (MediumMedium ).
Dr: Number of duration frames.
TextureAtlas Node
You can select the dragonbone export mode. If you select to export a large image, the TextureAtlas node represents the information about the small graph in the large graph and can be understood as the plist file generated by TexturePacker, such
The SubTexture node is the small Graph Information, the width and height are the length and width, and the x and y are the coordinates in the large graph. Cocos2dpX and cocos2dpY are still unknown.
The above content is the cocos2dx skeleton animation Armature source code analysis (2) shared by the students. Please stay tuned to this site.