コード例 #1
0
ファイル: UIAnimation.cs プロジェクト: ru-ace/spark
        /// <summary>Sets up general information for a particular animation and starts running it.</summary>
        private void Setup(Node animating, Style style, float duration, Blaze.VectorPath timeCurve)
        {
            Animating     = animating;
            ComputedStyle = (animating as IRenderableNode).ComputedStyle;

            if (duration <= 0f)
            {
                duration = 0f;
            }

            Duration  = duration;
            TimeCurve = timeCurve;

            // Start animating the properties now.

            foreach (KeyValuePair <CssProperty, Css.Value> kvp in style.Properties)
            {
                // Get the value:
                Css.Value value = kvp.Value;

                // Get the property:
                CssProperty property = kvp.Key;

                // Grab the type:
                Css.ValueType type = value.Type;

                // Animate it (note that we don't need to copy it):
                if (property == Css.Properties.TransformProperty.GlobalProperty)
                {
                    // Special case for animating transform.
                    AnimateTransform(value);
                }
                else if (type == Css.ValueType.Set)
                {
                    int count = value.Count;

                    for (int i = 0; i < count; i++)
                    {
                        // Get the correct aliased property and animate it:
                        Animate(property.GetAliased(i, true), value[i], (i == (count - 1)));
                    }
                }
                else
                {
                    Animate(property, value, true);
                }
            }
        }
コード例 #2
0
 public ValueType(Css.ValueType type)
 {
     Type = type;
 }