Exemple #1
0
        public void Animate(
            string animationName,
            Bind pctl,
            IBaseModel model,
            string propertyName,
            object endValue,
            float start,
            float length)
        {
            if (model.GetPropertyByName(propertyName).GetType().Equals(typeof(int)))
            {
                KineticPath path = new KineticPath(
                    (int)pctl.Get(),
                    (int)endValue,
                    length);

                PropertyAnimation anim = new PropertyAnimation(animationName, path.ComputeFrame, pctl);
                anim.Start = GetCurrentGameTime() + start;
                anim.End   = GetCurrentGameTime() + length + start;
                AddAnimation(animationName, anim);
            }
            else
            {
                throw new NotImplementedException("Only integers can be animated now!!!");
            }
        }
Exemple #2
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);
        }