public void Animate(string name, float offsetTime, float duration) { switch (name.ToLowerInvariant()) { case "flyinleft": var left = new FlyInLeft(Vector2.Zero, offsetTime, duration); left.From = -GetDimensions().X - 10; CurrentAnimation = left; CurrentAnimation.Begin(aspectRatio); break; case "flyinright": var right = new FlyInRight(Vector2.Zero, offsetTime, duration); CurrentAnimation = right; CurrentAnimation.Begin(aspectRatio); break; case "flyoutleft": var outleft = new FlyOutLeft(Vector2.Zero, offsetTime, duration); outleft.To = -GetDimensions().X - 10; CurrentAnimation = outleft; CurrentAnimation.Begin(aspectRatio); break; case "flyoutright": var outright = new FlyOutRight(Vector2.Zero, aspectRatio, Width, offsetTime, duration); CurrentAnimation = outright; CurrentAnimation.Begin(aspectRatio); break; case "flyinbottom": var inbottom = new FlyInBottom(Vector2.Zero, offsetTime, duration); CurrentAnimation = inbottom; CurrentAnimation.Begin(aspectRatio); break; case "flyoutbottom": var outbottom = new FlyOutBottom(Vector2.Zero, offsetTime, duration); CurrentAnimation = outbottom; CurrentAnimation.Begin(aspectRatio); break; } }
public void Animate(string name, float offsetTime, float duration) { switch (name.ToLowerInvariant()) { case "flyinleft": var left = new FlyInLeft(Vector2.Zero, offsetTime, duration); left.From = -GetDimensions().X - 10; CurrentAnimation = left; CurrentAnimation.Begin(); break; case "flyoutleft": var outleft = new FlyOutLeft(Vector2.Zero, offsetTime, duration); outleft.To = -GetDimensions().X - 10; CurrentAnimation = outleft; CurrentAnimation.Begin(); break; } }