public void Update(GameTime gameTime) { var et = (float)gameTime.ElapsedGameTime.TotalSeconds; frameRunTime += et; AnimationState = AnimationState.Running; if (frameRunTime > frameTime) { if (currentFrame < Frames.Count() - 1) { currentFrame++; } else if (Loop) { currentFrame = 0; } else { AnimationState = AnimationState.Finished; } frameRunTime = 0.0f; } animationEffects[currentEffect].Update(gameTime); }
public void TryAdvance() { if (Frames.Count() <= 0) { return; } long currentTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; if (_lastSwitch + AnimationDelay > currentTime) { _lastSwitch = currentTime; _currentFrame += 1; _currentFrame %= Frames.Count(); CurrentFrame = Frames[_currentFrame]; Advance = true; } }
public void AddFrame(string frameAsString) { Frame frame; if (Frames.Count() < 9) { frame = new StandardFrame(_currentFrame, frameAsString); if (_currentFrame != null) { _currentFrame.LinkNext(frame); } _currentFrame = frame; } else { frame = new TenthFrame(_currentFrame, frameAsString); _currentFrame.LinkNext(frame); _currentFrame = frame; } }
public override string ToString() { return(String.Format("{0} Fields, {1} Frames", Fields.Count(), Frames.Count())); }
public override string ToString() { return(Name + " Frames:" + Frames.Count()); }