Esempio n. 1
0
        /// <summary>
        /// Sets a time curve which progresses the overall slides animation.
        /// Almost always linear but change it for advanced effects.</summary>
        public void setTimingFunction(Css.Value timingFunc)
        {
            // The function to use:
            Blaze.VectorPath path = null;

            if (timingFunc != null)
            {
                // Get the defined vector path:
                path = timingFunc.GetPath(
                    style == null? null : style.RenderData,
                    Css.Properties.TimelineTimingFunction.GlobalProperty
                    );
            }

            if (path == null)
            {
                progressSampler = null;
            }
            else
            {
                if (!(path is Blaze.RasterVectorPath))
                {
                    Blaze.RasterVectorPath rvp = new Blaze.RasterVectorPath();
                    path.CopyInto(rvp);
                    rvp.ToStraightLines();
                    path = rvp;
                }

                progressSampler = new Blaze.CurveSampler(path);
                progressSampler.Reset();
            }
        }
Esempio n. 2
0
        /// <summary>Animates this property now.</summary>
        /// <param name="animation">The animation that this property is a part of.</param>
        /// <param name="targetValue">The parsed value that this property will be when the animation is over.</param>
        /// <param name="timeCurve">Optional curve used to describe the progression of the animation.
        /// X is time, Y is value. Null acts like linear (a line from 0,0 to 1,1).</param>
        /// <param name="updateCss">True if this particular property should flush its changes to css/the screen.</param>
        public void Animate(UIAnimation animation, Css.Value targetValue, Blaze.VectorPath timeCurve, bool updateCss)
        {
            Animation   = animation;
            CurrentTime = 0f;
            UpdateCss   = updateCss;
            RawTarget   = targetValue;

            if (timeCurve == null)
            {
                ProgressSampler = null;
            }
            else
            {
                if (!(timeCurve is Blaze.RasterVectorPath))
                {
                    Blaze.RasterVectorPath rvp = new Blaze.RasterVectorPath();
                    timeCurve.CopyInto(rvp);
                    rvp.ToStraightLines();
                    timeCurve = rvp;
                }

                ProgressSampler = new Blaze.CurveSampler(timeCurve);
                ProgressSampler.Reset();
            }
        }