Beispiel #1
0
 IEnumerator <object> GetScaleCoroutine(asd.DrawnObject2D object2D, ScaleAnimationElement scale)
 {
     asd.Vector2DF start = scale.isRequireFrom ? scale.from : object2D.Scale;
     for (int i = 1; i <= scale.frame; i++)
     {
         object2D.Scale = new asd.Vector2DF(GetEasing(scale.easing, i, start.X, scale.to.X, scale.frame), GetEasing(scale.easing, i, start.Y, scale.to.Y, scale.frame));
         yield return(null);
     }
 }
Beispiel #2
0
        public void ScaleTo(asd.Vector2DF to, int frame, Easing easing = Easing.Linear)
        {
            var element = new ScaleAnimationElement
            {
                to            = to,
                frame         = frame > 0 ? frame : 1,
                easing        = easing,
                isRequireFrom = false
            };

            animationElements.Add(element);
        }