public Animation(float delay, params string[] frameNames) { DelayPerUnit = delay; Loops = 1; Frames = new Bag<AnimationFrame>(); foreach (var frameName in frameNames) Frames.Add(new AnimationFrame(SkidiGame.ResourceManager.GetFrame(frameName), 1f)); Frames.Seal(); TotalDelayUnits = Frames.Count; }
public Animation(IEnumerable<TextureFrame> frames, float delay, uint loops = 1) { DelayPerUnit = delay; Loops = loops; Frames = new Bag<AnimationFrame>(); foreach (var textureFrame in frames) Frames.Add(new AnimationFrame(textureFrame, 1f)); Frames.Seal(); TotalDelayUnits = Frames.Count; }
public Animation(IEnumerable<AnimationFrame> frames, float delayPerUnit, uint loops) { DelayPerUnit = delayPerUnit; Loops = loops; Frames = new Bag<AnimationFrame>(); TotalDelayUnits = 0; foreach (var animationFrame in frames) { Frames.Add(animationFrame); TotalDelayUnits += animationFrame.DelayUnits; } Frames.Seal(); }