Esempio n. 1
0
        public override void GetPosition(int currentFrame, out int offsetX, out int offsetY)
        {
            // position varie de 0 à 1
            double position;

            if (currentFrame > MaximumFrame)
            {
                position = 1;
            }
            else if (currentFrame <= 0)
            {
                position = 0;
            }
            else
            {
                position = (double)currentFrame / (double)MaximumFrame;
            }

            offsetX = (int)(Easings.Interpolate(position, EasingX) * Width) * DirectionX;
            offsetY = (int)(Easings.Interpolate(position, EasingY) * Height) * DirectionY;
        }
Esempio n. 2
0
        public double GetEasingFromFrame(EasingFunctions easing, int currentFrame)
        {
            var step = (double)currentFrame / (double)MaximumFrame;

            return(Easings.Interpolate(step, easing));
        }