コード例 #1
0
        /// <summary>
        /// Läd das SpineObject neu.
        /// </summary>
        public void LoadNewSpineObject(string pSkeletonName)
        {
            mPlaying = false;
            mEditorForm.listBoxFadingFrom.Items.Clear();
            mEditorForm.listBoxFadingTo.Items.Clear();
            mEditorForm.listBoxFadingFrom.ClearSelected();
            mEditorForm.listBoxFadingTo.ClearSelected();
            SpineDataManager.Instance.Unload();
            SpineDataManager.Instance.LoadContent();
            mSpine = new SpineObject(pSkeletonName);
            mSpine.LoadContent();

            //Color Texture laden
            FileStream fileStream = new FileStream(EngineSettings.DefaultPathSpine + "\\" + pSkeletonName + ".png", FileMode.Open, FileAccess.Read);

            mSpine.Textures[0] = Texture2D.FromStream(EngineSettings.Graphics.GraphicsDevice, fileStream);

            List <string> TmpFadingListOutputFrom = new List <string>();

            foreach (SpineData.AnimationMix animMix in SpineDataManager.Instance.GetElementByString(pSkeletonName).settings.AnimationFading)
            {
                if (!TmpFadingListOutputFrom.Contains(animMix.From.ToString()))
                {
                    TmpFadingListOutputFrom.Add(animMix.From.ToString());
                }
            }
            mEditorForm.listBoxFadingFrom.Items.AddRange(TmpFadingListOutputFrom.ToArray());
            mEditorForm.numericUpDownScaling.Value = (decimal)SpineDataManager.Instance.GetElementByString(pSkeletonName).settings.Scaling;
            if (!mEditorForm.checkBoxLockView.Checked)
            {
                ResetView();
            }
            ApplyView();
        }
コード例 #2
0
        //Richtige Animation und richtigen FlipState anwenden
        public static void AnimateAccordingToDirection(SpineObject pSpine, Vector2 pDirection, string pAnimUp, string pAnimDown, string pAnimSide)
        {
            string anim = Character.GetRightDirectionAnimation(pDirection, pAnimUp, pAnimDown, pAnimSide);

            Character.SetSkeletonFlipState(pSpine, pDirection);
            Sequences.StartAnimation(pSpine, anim);
        }
コード例 #3
0
ファイル: Gretel.cs プロジェクト: HaenselUndGretel/HG_Data
 public override void Initialize()
 {
     base.Initialize();
     mInput = InputHelper.Player2;
     mCollisionBox.Width  = 40;
     mCollisionBox.Height = 90;
     mModel = new SpineObject("sweetcheeks");
     mAbilities.Remove(Activity.JumpOverGap);
 }
コード例 #4
0
ファイル: Hansel.cs プロジェクト: HaenselUndGretel/HG_Data
 public override void Initialize()
 {
     base.Initialize();
     mInput = InputHelper.Player1;
     mCollisionBox.Width  = 50;
     mCollisionBox.Height = 100;
     mModel = new SpineObject("ashbrett");
     mAbilities.Remove(Activity.Crawl);
     mAbilities.Remove(Activity.SlipThroughRock);
     mAbilities.Remove(Activity.UseChalk);
 }
コード例 #5
0
 //Animation Stepping
 public static void UpdateAnimationStepping(SpineObject pSpine, float pProgress)
 {
     if (pProgress > 0.9f)
     {
         pProgress = 0.9f;
     }
     if (pSpine.AnimationState.ToString() == "<none>")
     {
         return;
     }
     //if (pSpine.AnimationState.ToString() == "<none>") throw new Exception("SpineObjekt hat keinen AnimationState. TmpFix = return.");
     pSpine.AnimationState.GetCurrent(0).Time = pSpine.AnimationState.GetCurrent(0).EndTime *pProgress;
 }
コード例 #6
0
        public override void Update()
        {
            HandleInput();
            if (mSpine != null && mPlaying)
            {
                mSpine.Update();
            }

            if (mEditorForm.listBoxSkeletons.SelectedItem == null)
            {
                mSpine = null;
            }
        }
コード例 #7
0
 public static void SetSkeletonFlipState(SpineObject pSpineObj, Vector2 pAnimDirection)
 {
     pAnimDirection.Normalize();
     if (pAnimDirection.X > 0)
     {
         pSpineObj.Flip = true;
     }
     else if (pAnimDirection.X < 0)
     {
         pSpineObj.Flip = false;
     }
     if (pSpineObj.AnimationState.GetCurrent(0) != null && (pAnimDirection.X == 0 && (pSpineObj.AnimationState.GetCurrent(0).animation.name.Contains("Down") || pSpineObj.AnimationState.GetCurrent(0).animation.name.Contains("Up"))))
     {
         pSpineObj.Flip = false;
     }
 }
コード例 #8
0
        //Player während Animation bewegen
        public static void SynchMovementToAnimation(SpineObject pSpineToSynchTo, Player pPlayer, Vector2 pSource, Vector2 pDestination)
        {
            float Progress = pSpineToSynchTo.AnimationState.GetCurrent(0).Time / pSpineToSynchTo.AnimationState.GetCurrent(0).EndTime;

            SetToPosition(pPlayer, pSource + (pDestination - pSource) * Progress);
        }
コード例 #9
0
 //Start Animation
 public static void StartAnimation(SpineObject pSpine, string pAnimation, bool pLoop = false)
 {
     pSpine.SetAnimation(pAnimation, pLoop, true);
 }
コード例 #10
0
 public void SetHero(GraphicsDevice graphicDevice, float baseScale)
 {
     Hero = new SpineObject(graphicDevice, "Sample", baseScale, Position);
     Hero.State.SetAnimation(0, "стоять ", true);
 }
コード例 #11
0
 public static bool AnimationComplete(SpineObject pSpine)
 {
     return(pSpine.AnimationComplete);
 }