public void AnimateColor( string animationName, Bind pctl, object endValue, float length) { ColorAnimationPath path = new ColorAnimationPath( (Color)pctl.Get(), (Color)endValue, length); PropertyAnimation anim = new PropertyAnimation(animationName, path.ComputeFrame, pctl); anim.Start = CoreAnimation.Instance.GetCurrentGameTime(); anim.End = CoreAnimation.Instance.GetCurrentGameTime() + length; CoreAnimation.Instance.AddAnimation(animationName, anim); }
public void ToggleProperty( string animationName, Bind pctl, object startValue, object endValue, float start, float length, float period) { BlinkPath path = new BlinkPath(startValue, endValue, period, length); PropertyAnimation anim = new PropertyAnimation(animationName, path.ComputeFrame, pctl); anim.Start = GetCurrentGameTime() + start; anim.End = GetCurrentGameTime() + length + start; AddAnimation(animationName, anim); }
public void StartTransition(int x0, int y0, int x1, int y1, double delay, double duration) { isDuringTransition = true; x = x0; y = y0; Bind pctl = new Bind( delegate { return(x); }, delegate(object value) { x = (int)value; } ); core2d.CoreAnimation.Instance.Animate( "transition of " + Name, pctl, x0, x1, (float)delay, (float)duration); }
public void Animate( string animationName, Bind pctl, object startValue, object endValue, float start, float length) { KineticPath path = new KineticPath( (int)startValue, (int)endValue, length); PropertyAnimation anim = new PropertyAnimation(animationName, path.ComputeFrame, pctl); anim.Start = GetCurrentGameTime() + start; anim.End = GetCurrentGameTime() + length + start; AddAnimation(animationName, anim); }