Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkeletonBodyItem"/> class.
 /// </summary>
 /// <param name="itemInfo">SkeletonBodyItemInfo to create the SkeletonBodyItem from</param>
 public SkeletonBodyItem(SkeletonBodyItemInfo itemInfo)
 {
     _itemInfo = itemInfo;
     var grhData = GrhInfo.GetData(_itemInfo.GrhIndex);
     if (grhData != null)
         Grh = new Grh(grhData, AnimType.Loop, 0);
 }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SkeletonBodyItem"/> class.
        /// </summary>
        /// <param name="itemInfo">SkeletonBodyItemInfo to create the SkeletonBodyItem from</param>
        public SkeletonBodyItem(SkeletonBodyItemInfo itemInfo)
        {
            _itemInfo = itemInfo;
            var grhData = GrhInfo.GetData(_itemInfo.GrhIndex);

            if (grhData != null)
            {
                Grh = new Grh(grhData, AnimType.Loop, 0);
            }
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkeletonBodyInfo"/> class.
 /// </summary>
 /// <param name="items">SkeletonBodyItemInfos to create the SkeletonBodyInfo from.</param>
 public SkeletonBodyInfo(SkeletonBodyItemInfo[] items)
 {
     _items = items;
 }
Пример #4
0
 /// <summary>
 /// Handles the Click event of the btnAdd control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (cmbSkeletonBodies.SelectedItem == null || cmbSkeletonBodyNodes.SelectedItem == null)
             return;
         var skelBodies = cmbSkeletonBodies.SelectedItem.ToString();
         var skelBodyNodes = cmbSkeletonBodyNodes.SelectedItem.ToString();
         Array.Resize(ref SkeletonBody.BodyItems, SkeletonBody.BodyItems.Length + 1);
         var spriteCategorization = new SpriteCategorization("Character.Skeletons." + skelBodies, skelBodyNodes);
         var grhData = GrhInfo.GetData(spriteCategorization);
         if (grhData == null)
             return;
         var bodyItemInfo = new SkeletonBodyItemInfo(grhData.GrhIndex, _skeleton.RootNode.Name, string.Empty,
             Vector2.Zero, Vector2.Zero);
         var bodyItem = new SkeletonBodyItem(bodyItemInfo);
         SkeletonBody.BodyItems[SkeletonBody.BodyItems.Length - 1] = bodyItem;
         UpdateBodyList();
     }
     catch
     {
     }
 }
Пример #5
0
 /// <summary>
 /// Handles the Click event of the btnAdd control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void btnAdd_Click(object sender, EventArgs e)
 {
     Array.Resize(ref SkeletonBody.BodyItems, SkeletonBody.BodyItems.Length + 1);
     var spriteCategorization = new SpriteCategorization("Character.Naked", "Body");
     var grhData = GrhInfo.GetData(spriteCategorization);
     var bodyItemInfo = new SkeletonBodyItemInfo(grhData.GrhIndex, _skeleton.RootNode.Name, string.Empty, Vector2.Zero,
         Vector2.Zero);
     var bodyItem = new SkeletonBodyItem(bodyItemInfo);
     SkeletonBody.BodyItems[SkeletonBody.BodyItems.Length - 1] = bodyItem;
     UpdateBodyList();
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkeletonBodyItem"/> class.
 /// </summary>
 /// <param name="itemInfo">SkeletonBodyItemInfo to create the SkeletonBodyItem from</param>
 /// <param name="skeleton">Skeleton to attach to</param>
 public SkeletonBodyItem(SkeletonBodyItemInfo itemInfo, Skeleton skeleton) : this(itemInfo)
 {
     Attach(skeleton);
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkeletonBodyItem"/> class.
 /// </summary>
 /// <param name="itemInfo">SkeletonBodyItemInfo to create the SkeletonBodyItem from</param>
 /// <param name="skeleton">Skeleton to attach to</param>
 public SkeletonBodyItem(SkeletonBodyItemInfo itemInfo, Skeleton skeleton) : this(itemInfo)
 {
     Attach(skeleton);
 }