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; }
public double GetEasingFromFrame(EasingFunctions easing, int currentFrame) { var step = (double)currentFrame / (double)MaximumFrame; return(Easings.Interpolate(step, easing)); }