Ejemplo n.º 1
0
        private void UpdateValueBackward(float time)
        {
            var v = Easing.Calculate(To, From, time);

            _y = _rect.Bottom - v + dec;
            _callback(_x, _y);

            if (_y < _rect.Top)
            {
                dec = v;
                _x--;
            }
        }
Ejemplo n.º 2
0
        private void UpdateValueForwardNotFilled(float time)
        {
            var v = Easing.Calculate(From, To, time);

            if (_y <= _rect.Top)
            {
                _x = _rect.Left + v;

                if (_x >= _rect.Right - 1)
                {
                    _x  = _rect.Right - 1;
                    _y  = _rect.Top + 1;
                    dec = v;
                }
            }
            else if (_x >= _rect.Right - 1)
            {
                _y = _rect.Top + v - dec;

                if (_y >= _rect.Bottom - 1)
                {
                    _y  = _rect.Bottom - 1;
                    _x  = _rect.Right - 2;
                    dec = v;
                }
            }
            else if (_y >= _rect.Bottom - 1)
            {
                _x = _rect.Right - 1 - (v - dec);

                if (_x <= _rect.Left)
                {
                    _x  = _rect.Left;
                    _y  = _rect.Bottom - 2;
                    dec = v;
                }
            }
            else
            {
                _y = _rect.Bottom - 2 - v + dec;

                if (_y < _rect.Top)
                {
                    _y = _rect.Top;
                }
            }

            _callback(_x, _y);
        }
Ejemplo n.º 3
0
        private void UpdateValueForwardFilled(float time)
        {
            var v = Easing.Calculate(From, To, time);

            _y = _rect.Top + v - dec;

            if (_y >= _rect.Bottom)
            {
                dec = v;
                _x++;
                _y = _rect.Bottom;
            }

            _callback(_x, _y);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Updates the value.
 /// </summary>
 /// <param name="time">The animation time.</param>
 protected override void UpdateValue(float time)
 {
     Owner.Position = new Point(
         Easing.Calculate(From.X, To.X, time),
         Easing.Calculate(From.Y, To.Y, time));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Updates the value.
 /// </summary>
 /// <param name="time">The animation time.</param>
 protected override void UpdateValue(float time)
 {
     callback(new Point(
                  Easing.Calculate(From.X, To.X, time),
                  Easing.Calculate(From.Y, To.Y, time)));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Updates the value.
 /// </summary>
 /// <param name="time">The animation time.</param>
 protected override void UpdateValue(float time)
 {
     _changeValue(Easing.Calculate(From, To, time));
 }