Ejemplo n.º 1
0
        private static void loadRefs(List<XmlNode
			> objectRefs, List<XmlNode
			> boneRefs, Key key)
        {
            for (int i = 0; i < boneRefs.Count; i++)
            {
                XmlNode o = boneRefs[i];
                BoneRef bone = new BoneRef(
                    );
                bone.setId(XmlReader.getInt(o,"id" ));
                bone.setKey(XmlReader.getInt(o,"key" ));
                int par = XmlReader.getInt(o, "parent", -1);
                bone.setParent(par);
                bone.setTimeline(XmlReader.getInt(o,"timeline" ));
                key.getBoneRef().Add(bone);
            }
            for (int i_1 = 0; i_1 < objectRefs.Count; i_1++)
            {
                XmlNode o = objectRefs[i_1];
                AnimationObjectRef @object = new AnimationObjectRef
                    ();
                @object.setId(XmlReader.getInt(o,"id" ));
                @object.setKey(XmlReader.getInt(o,"key" ));
                int par = XmlReader.getInt(o, "parent", -1);
                @object.setParent(par);
                @object.setTimeline(XmlReader.getInt(o,"timeline" ));
                @object.setZIndex(XmlReader.getInt(o,"z_index" ));
                key.getObjectRef().Add(@object);
            }
        }
Ejemplo n.º 2
0
 private static void loadTimelineKeys(List<XmlNode> keys, 
     TimeLine timeline)
 {
     for (int i = 0; i < keys.Count; i++)
     {
         XmlNode k = keys[i];
         XmlNode obj = XmlReader.getChildByName(k, "bone");
         Key key = new Key();
         key.setId(XmlReader.getInt(k,"id" ));
         key.setSpin(XmlReader.getInt(k,"spin", 1));
         key.setTime(System.Convert.ToInt64(XmlReader.getInt(k,"time", 0 )));
         string name = XmlReader.getAttribute(k.ParentNode, "name");
         timeline.setName(name);
         if (obj != null)
         {
             Bone bone = new Bone();
             bone.setAngle(XmlReader.getFloat(obj,"angle", 0f ));
             bone.setX(XmlReader.getFloat(obj,"x", 0f ));
             bone.setY(XmlReader.getFloat(obj,"y", 0f ));
             bone.setScaleX(XmlReader.getFloat(obj,"scale_x", 1f ));
             bone.setScaleY(XmlReader.getFloat(obj,"scale_y", 1f ));
             key.setBone(bone);
         }
         else
         {
             AnimationObject @object = new AnimationObject
                 ();
             obj = XmlReader.getChildByName(k, "object");
             @object.setAngle(XmlReader.getFloat(obj,"angle", 0f ));
             @object.setX(XmlReader.getFloat(obj,"x", 0f ));
             @object.setY(XmlReader.getFloat(obj,"y", 0f ));
             @object.setScaleX(XmlReader.getFloat(obj,"scale_x", 1f ));
             @object.setScaleY(XmlReader.getFloat(obj,"scale_y", 1f ));
             @object.setFolder(XmlReader.getInt(obj,"folder" ));
             @object.setFile(XmlReader.getInt(obj,"file" ));
             File f = data.getFolder()[@object.getFolder()].getFile
                 ()[@object.getFile()];
             @object.setPivotX(XmlReader.getFloat(obj,"pivot_x", f.getPivotX()));
             @object.setPivotY(XmlReader.getFloat(obj,"pivot_y", f.getPivotY()));
             key.getObject().Add(@object);
         }
         timeline.getKey().Add(key);
     }
 }
Ejemplo n.º 3
0
        private static void loadMainlineKeys(List<XmlNode
			> keys, MainLine main)
        {
            for (int i = 0; i < keys.Count; i++)
            {
                XmlNode k = keys[i];
                Key key = new Key();
                key.setId(XmlReader.getInt(k,"id" ));
                int time = XmlReader.getInt(k, "time", -1);
                if (time == -1) key.setTime(0);
                else key.setTime(System.Convert.ToInt64(time));
                main.getKey().Add(key);
                loadRefs(XmlReader.getChildrenByName(k, "object_ref"), XmlReader.getChildrenByName(k, "bone_ref"), key);
            }
        }