Ejemplo n.º 1
0
        static KeyFrame ParseKeyframe(JToken token)
        {
            var keyFrame = new KeyFrame {
                Name = (string)token["id"],
                Position = (int)token["position"],
                Duration = (int)token["duration"],
            };

            JToken easing;
            if (((JObject)token).TryGetValue ("easing", out easing)) {
                var eas = (string)easing;
                if (eas == "easeOutCubic")
                    keyFrame.Easing = EdgeEasing.EaseOut;
            }

            var tween = token["tween"] as JArray;
            keyFrame.ObjectName = (string)tween [1];
            keyFrame.Tween = ParseObjectState(new []{(string)tween[0],(string)tween[2],(string)tween[3]});
            keyFrame.FromValue = ((string)tween [4] ["fromValue"]).Replace ("'", "");

            return keyFrame;
        }
Ejemplo n.º 2
0
 static bool ShouldAnimate(this KeyFrame frame, int currentTime)
 {
     return(frame.Position < currentTime);
 }