Ejemplo n.º 1
0
        public AnimationController(
            float?value                         = null,
            TimeSpan?duration                   = null,
            TimeSpan?reverseDuration            = null,
            string debugLabel                   = null,
            float lowerBound                    = 0.0f,
            float upperBound                    = 1.0f,
            AnimationBehavior animationBehavior = AnimationBehavior.normal,
            TickerProvider vsync                = null
            )
        {
            D.assert(upperBound >= lowerBound);
            D.assert(vsync != null);
            _direction = _AnimationDirection.forward;

            this.duration          = duration;
            this.reverseDuration   = reverseDuration;
            this.debugLabel        = debugLabel;
            this.lowerBound        = lowerBound;
            this.upperBound        = upperBound;
            this.animationBehavior = animationBehavior;

            _ticker = vsync.createTicker(_tick);
            _internalSetValue(value ?? lowerBound);
        }
Ejemplo n.º 2
0
        public void resync(TickerProvider vsync)
        {
            Ticker oldTicker = _ticker;

            _ticker = vsync.createTicker(_tick);
            _ticker.absorbTicker(oldTicker);
        }
Ejemplo n.º 3
0
        AnimationController(
            float value                         = 0.0f,
            TimeSpan?duration                   = null,
            TimeSpan?reverseDuration            = null,
            string debugLabel                   = null,
            AnimationBehavior?animationBehavior = null,
            TickerProvider vsync                = null
            )
        {
            D.assert(vsync != null);
            D.assert(animationBehavior != null);
            lowerBound = float.NegativeInfinity;
            upperBound = float.PositiveInfinity;
            _direction = _AnimationDirection.forward;

            this.duration          = duration;
            this.reverseDuration   = reverseDuration;
            this.debugLabel        = debugLabel;
            this.animationBehavior = animationBehavior.Value;

            _ticker = vsync.createTicker(_tick);
            _internalSetValue(value);
        }