Phaser.Math.Easing.Elastic
Scope: static
Static functions
In
<static> In(v, [amplitude], [period])
Description:
An elastic ease-in, where the value oscillates back and forth with a spring-like motion before accelerating toward the target. The effect begins with a series of small oscillations that grow in magnitude, simulating a stretched elastic band being released. Use this when you want a tween to feel springy or bouncy at its start before snapping into motion.
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| v | number | No | The value to be eased, between 0 and 1. | |
| amplitude | number | Yes | 0.1 | The amplitude of the elastic oscillation. Values below 1 are clamped to 1. Higher values produce a wider oscillation arc. |
| period | number | Yes | 0.1 | Controls how tight the sine-wave oscillation is. Smaller values produce tighter, more frequent cycles; larger values produce wider, slower oscillations. |
Returns: number - The eased value.
Source: src/math/easing/elastic/In.js#L7
Since: 3.0.0
InOut
<static> InOut(v, [amplitude], [period])
Description:
An Elastic ease-in/out, combining both the ease-in and ease-out elastic effects. This easing function produces a spring-like oscillation at both the start and end of the tween, overshooting the target value before settling. It is useful for animations that need a bouncy, elastic feel at both ends of the transition.
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| v | number | No | The value to be eased, typically in the range [0, 1]. | |
| amplitude | number | Yes | 0.1 | The amplitude of the elastic oscillation. Values below 1 are clamped to 1. |
| period | number | Yes | 0.1 | Controls how tight the sine-wave oscillation is. Smaller values produce tighter waves with more cycles. |
Returns: number - The eased value.
Source: src/math/easing/elastic/InOut.js#L7
Since: 3.0.0
Out
<static> Out(v, [amplitude], [period])
Description:
An Elastic ease-out, where the value overshoots its target and oscillates with a decaying sine wave before settling at the final value. The elastic effect occurs at the end of the transition, making the motion appear to bounce or spring into place. Accepts a normalized input value v in the range 0 to 1.
Parameters:
| name | type | optional | default | description |
|---|---|---|---|---|
| v | number | No | The normalized value to be tweened, typically in the range [0, 1]. | |
| amplitude | number | Yes | 0.1 | The amplitude of the elastic overshoot. Values above 1 increase the size of the overshoot. |
| period | number | Yes | 0.1 | Controls how tight the sine-wave oscillation is. Smaller values produce tighter waves with more rapid oscillations. |
Returns: number - The eased value.
Source: src/math/easing/elastic/Out.js#L7
Since: 3.0.0