getEasingValue
Shared
Works out an easing curve's value at a point of the progress.
float getEasingValue(float progress, string easingType [, float easingPeriod = 0.3, float easingAmplitude = 1, float easingOvershoot = 1.70158])
Parameters
| Name | Type | Description |
|---|---|---|
| progress | float | The progress, from 0 to 1. |
| easingType | string | The easing curve, such as "Linear", "InOutQuad", "OutBounce" or "SineCurve". |
| easingPeriod | float | The period of the elastic curves.default 0.3 |
| easingAmplitude | float | The amplitude of the elastic and bounce curves.default 1 |
| easingOvershoot | float | How far the Back curves overshoot the target.default 1.70158 |
Returns
The curve's value, usually from 0 to 1 (curves such as OutBack and OutElastic go past it).
Example
local start = getTickCount()
addEventHandler("onClientRender", root, function()
local progress = math.min((getTickCount() - start) / 1000, 1)
local alpha = getEasingValue(progress, "OutQuad") * 255
end)