public void AppendAnimationIntoCycle(AnimationInstance newAnimation, bool clearAnimationCycle = false) { if (clearAnimationCycle) { AnimationCycle.Clear(); } AnimationCycle.Add(newAnimation); CreateFlipbookInstances(); }
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); }
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); }