/// <summary> /// Draws the animation with the given SpriteBatch. /// </summary> public virtual void Draw(SpriteBatch batch) { for (int i = 0; i < DrawInfos.Count; ++i) { DrawInfo di = DrawInfos[i]; Sprite sprite = di.Sprite; batch.Draw(sprite.Texture, di.Position, sprite.SourceRectangle, di.Color, di.Rotation, di.Origin, di.Scale, di.Effects, di.Depth); DrawInfoPool.Push(di); } }
public override void Update(float deltaTime) { for (int i = 0; i < DrawInfos.Count; ++i) { DrawInfoPool.Push(DrawInfos[i]); } DrawInfos.Clear(); base.Update(deltaTime); }