コード例 #1
0
 public void AppendAnimationIntoCycle(AnimationInstance newAnimation, bool clearAnimationCycle = false)
 {
     if (clearAnimationCycle)
     {
         AnimationCycle.Clear();
     }
     AnimationCycle.Add(newAnimation);
     CreateFlipbookInstances();
 }
コード例 #2
0
        public Flipbook(Vector2 position, Vector2 pivot,
                        int spriteWidth, int spriteHeight, string texture2DPath,
                        AnimationInstance animationInstance,
                        float layerDepth, float rotation = 0) : base()
        {
            List <AnimationInstance> aiL = new List <AnimationInstance>();

            aiL.Add(animationInstance);

            CreateFlipbook(this, position, pivot,
                           spriteWidth, spriteHeight, texture2DPath,
                           aiL, layerDepth, rotation);
        }
コード例 #3
0
        private static List <Flipbook> BuildParticle(int particleNumber, Vector2 pivot, string particlePath, int numberOfFrames)
        {
            List <Flipbook> flipbookList = new List <Flipbook>();

            for (; particleNumber > 0; particleNumber--)
            {
                AnimationInstance animationInstance = new AnimationInstance();
                animationInstance.StartingFrame = animationInstance.EndingFrame = Parameter.Random.Next(0, numberOfFrames);

                flipbookList.Add(new Flipbook(Vector2.Zero, pivot, (int)(pivot.X * 2), (int)(pivot.Y * 2),
                                              particlePath, animationInstance, DepthParameter.Projectile));
            }

            return(flipbookList);
        }