Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }