M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
progressfloatThe progress, from 0 to 1.
easingTypestringThe easing curve, such as "Linear", "InOutQuad", "OutBounce" or "SineCurve".
easingPeriodfloatThe period of the elastic curves.default 0.3
easingAmplitudefloatThe amplitude of the elastic and bounce curves.default 1
easingOvershootfloatHow 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)

See also