sm.util.easing

Applies an easing function to a given input.

Kind: Function

Environments: Game, Terrain

Game

Game overload 1

sm.util.easing( easingFunctionId, p )

Open the full Game reference

Parameters:

Name Type Description
easingFunctionId integer The easing function to use. (See sm.util.easingFunctionIds)
p number The easing function input.

Returns:

Type Description
number The output.

Game overload 2

sm.util.easing( easing, p )

Open the full Game reference

Easing function names:

Value
linear
easeInQuad
easeOutQuad
easeInOutQuad
easeInCubic
easeOutCubic
easeInOutCubic
easeInQuart
easeOutQuart
easeInOutQuart
easeInQuint
easeOutQuint
easeInOutQuint
easeInSine
easeOutSine
easeInOutSine
easeInCirc
easeOutCirc
easeInOutCirc
easeInExpo
easeOutExpo
easeInOutExpo
easeInElastic
easeOutElastic
easeInOutElastic
easeInBack
easeOutBack
easeInOutBack
easeInBounce
easeOutBounce
easeInOutBounce

Parameters:

Name Type Description
easing string The easing function name.
p number The easing function input.

Returns:

Type Description
number The output.

Terrain

Terrain overload 1

sm.util.easing( easingFunctionId, p )

Open the full Terrain reference

Parameters:

Name Type Description
easingFunctionId integer The easing function to use. (See sm.util.easingFunctionIds)
p number The easing function input.

Returns:

Type Description
number The output.

Terrain overload 2

sm.util.easing( easing, p )

Open the full Terrain reference

Easing function names:

Value
linear
easeInQuad
easeOutQuad
easeInOutQuad
easeInCubic
easeOutCubic
easeInOutCubic
easeInQuart
easeOutQuart
easeInOutQuart
easeInQuint
easeOutQuint
easeInOutQuint
easeInSine
easeOutSine
easeInOutSine
easeInCirc
easeOutCirc
easeInOutCirc
easeInExpo
easeOutExpo
easeInOutExpo
easeInElastic
easeOutElastic
easeInOutElastic
easeInBack
easeOutBack
easeInOutBack
easeInBounce
easeOutBounce
easeInOutBounce

Parameters:

Name Type Description
easing string The easing function name.
p number The easing function input.

Returns:

Type Description
number The output.