1 module re.util.tweens.ease; 2 3 static import easings; 4 5 public alias EaseFunction = float function(float, float, float, float); 6 7 /// ease functions 8 struct Ease { 9 pragma(inline, true) { 10 11 // Linear Easing functions 12 static float LinearNone(float t, float b, float c, float d) { 13 return easings.EaseLinearNone(t, b, c, d); 14 } 15 16 static float LinearIn(float t, float b, float c, float d) { 17 return easings.EaseLinearIn(t, b, c, d); 18 } 19 20 static float LinearOut(float t, float b, float c, float d) { 21 return easings.EaseLinearOut(t, b, c, d); 22 } 23 24 static float LinearInOut(float t, float b, float c, float d) { 25 return easings.EaseLinearInOut(t, b, c, d); 26 } 27 28 // Sine Easing functions 29 static float SineIn(float t, float b, float c, float d) { 30 return easings.EaseSineIn(t, b, c, d); 31 } 32 33 static float SineOut(float t, float b, float c, float d) { 34 return easings.EaseSineOut(t, b, c, d); 35 } 36 37 static float SineInOut(float t, float b, float c, float d) { 38 return easings.EaseSineInOut(t, b, c, d); 39 } 40 41 // Circular Easing functions 42 static float CircIn(float t, float b, float c, float d) { 43 return easings.EaseCircIn(t, b, c, d); 44 } 45 46 static float CircOut(float t, float b, float c, float d) { 47 return easings.EaseCircOut(t, b, c, d); 48 } 49 50 static float CircInOut(float t, float b, float c, float d) { 51 return easings.EaseCircInOut(t, b, c, d); 52 } 53 54 // Cubic Easing functions 55 static float CubicIn(float t, float b, float c, float d) { 56 return easings.EaseCubicIn(t, b, c, d); 57 } 58 59 static float CubicOut(float t, float b, float c, float d) { 60 return easings.EaseCubicOut(t, b, c, d); 61 } 62 63 static float CubicInOut(float t, float b, float c, float d) { 64 return easings.EaseCubicInOut(t, b, c, d); 65 } 66 67 // Quadratic Easing functions 68 static float QuadIn(float t, float b, float c, float d) { 69 return easings.EaseQuadIn(t, b, c, d); 70 } 71 72 static float QuadOut(float t, float b, float c, float d) { 73 return easings.EaseQuadOut(t, b, c, d); 74 } 75 76 static float QuadInOut(float t, float b, float c, float d) { 77 return easings.EaseQuadInOut(t, b, c, d); 78 } 79 80 // Exponential Easing functions 81 static float ExpoIn(float t, float b, float c, float d) { 82 return easings.EaseExpoIn(t, b, c, d); 83 } 84 85 static float ExpoOut(float t, float b, float c, float d) { 86 return easings.EaseExpoOut(t, b, c, d); 87 } 88 89 static float ExpoInOut(float t, float b, float c, float d) { 90 return easings.EaseExpoInOut(t, b, c, d); 91 } 92 93 // Back Easing functions 94 static float BackIn(float t, float b, float c, float d) { 95 return easings.EaseBackIn(t, b, c, d); 96 } 97 98 static float BackOut(float t, float b, float c, float d) { 99 return easings.EaseBackOut(t, b, c, d); 100 } 101 102 static float BackInOut(float t, float b, float c, float d) { 103 return easings.EaseBackInOut(t, b, c, d); 104 } 105 106 // Bounce Easing functions 107 static float BounceOut(float t, float b, float c, float d) { 108 return easings.EaseBounceOut(t, b, c, d); 109 } 110 111 static float BounceIn(float t, float b, float c, float d) { 112 return easings.EaseBounceIn(t, b, c, d); 113 } 114 115 static float BounceInOut(float t, float b, float c, float d) { 116 return easings.EaseBounceInOut(t, b, c, d); 117 } 118 119 // Elastic Easing functions 120 static float ElasticIn(float t, float b, float c, float d) { 121 return easings.EaseElasticIn(t, b, c, d); 122 } 123 124 static float ElasticOut(float t, float b, float c, float d) { 125 return easings.EaseElasticOut(t, b, c, d); 126 } 127 128 static float ElasticInOut(float t, float b, float c, float d) { 129 return easings.EaseElasticInOut(t, b, c, d); 130 } 131 } 132 }