Exemple #1
0
 public void AnimationSetReverse()
 {
     if (PointCollection.Count < 2)
     {
         throw new Exception("Not enough points to set animation. PointCount: " + PointCollection.Count.ToString());
     }
     _increment         = -1;
     _currentEndPoint   = PointCollection[PointCollection.Count - 2];
     _currentStartPoint = PointCollection[PointCollection.Count - 1];
     _lastPoint         = _currentStartPoint.Location;
     CurrentState       = AnimationState.Set;
 }
        public void ApplySkin(XmlNode pSkinNode, string pSkinPath)
        {
            base.ApplySkin(pSkinNode, pSkinPath);
            ClearAnimations();
            AnimationPath path = this.CreateAnimationPath();

            foreach (XmlNode pointNode in pSkinNode.SelectNodes(XPATH_ANIMATION_POINT))
            {
                AnimationPathPoint point = XmlHelper.GetAnimationPathPoint(pointNode.InnerText);
                if (path.AnimationPointCount == 0)
                {
                    SetLocation(point.Location);
                }
                path.AddAnimationPoint(point);
            }
            this.SetAnimation(-1);
        }
Exemple #3
0
        private AnimationPathPoint NextPoint(AnimationPathPoint pPreviousPoint)
        {
            int index = PointCollection.IndexOf(pPreviousPoint);

            if (index < 0)
            {
                throw new IndexOutOfRangeException("Invalid Point or Point not part of this Animation Path");
            }

            index += _increment;

            if (index < PointCollection.Count)
            {
                return(PointCollection[index]);
            }

            return(null);
        }
Exemple #4
0
 public void AddAnimationPoint(AnimationPathPoint pAnimationPoint)
 {
     PointCollection.Add(pAnimationPoint);
 }